|
RpgGame
Console Based RPG game in C#
|
Defines the contract for all items that can exist within the game world. More...
Public Member Functions | |
| string | GetDescription () |
| Returns a short textual description of the item. | |
| bool | OnPickup (Player player, Inventory inventory) |
| Handles the pickup interaction for the item. | |
| void | OnDrop (Level level, Player player) |
| Handles the drop interaction for the item. | |
Properties | |
| string | Name [get] |
| Gets the display name of the item. | |
| char | Symbol [get] |
| Gets the character symbol used to render the item on the map. | |
| ConsoleColor | color [get] |
| Gets the console color used to render the Items on the map. | |
Defines the contract for all items that can exist within the game world.
Implementations of IItem represent objects that can:
The pickup behavior may vary depending on the item type. For example, equippable items attempt to occupy a specific hand, while consumable items (such as coins) apply their effect immediately.
| string RpgGame.Items.IItem.GetDescription | ( | ) |
Returns a short textual description of the item.
Implemented in RpgGame.Items.Coin, RpgGame.Items.Gold, RpgGame.Items.Potion, RpgGame.Items.Thorn, and RpgGame.Items.Weapon.
Handles the drop interaction for the item.
| level | The current level. |
| player | The player dropping the item. |
Implemented in RpgGame.Items.Coin, RpgGame.Items.Gold, RpgGame.Items.Potion, RpgGame.Items.Thorn, and RpgGame.Items.Weapon.
Handles the pickup interaction for the item.
| player | The player interacting with the item. |
| pickUpLeft | Indicates whether the pickup action targets the left hand. This parameter is primarily relevant for equippable items. |
Implemented in RpgGame.Items.Coin, RpgGame.Items.Gold, RpgGame.Items.Potion, RpgGame.Items.Thorn, and RpgGame.Items.Weapon.
|
get |
Gets the console color used to render the Items on the map.
Implemented in RpgGame.Items.Coin, RpgGame.Items.DoubleSword, RpgGame.Items.Gold, RpgGame.Items.Potion, RpgGame.Items.Sword, RpgGame.Items.Thorn, and RpgGame.Items.Weapon.
|
get |
Gets the display name of the item.
Implemented in RpgGame.Items.Coin, RpgGame.Items.DoubleSword, RpgGame.Items.Gold, RpgGame.Items.Potion, RpgGame.Items.Sword, RpgGame.Items.Thorn, and RpgGame.Items.Weapon.
|
get |
Gets the character symbol used to render the item on the map.
Implemented in RpgGame.Items.Coin, RpgGame.Items.DoubleSword, RpgGame.Items.Gold, RpgGame.Items.Potion, RpgGame.Items.Sword, RpgGame.Items.Thorn, and RpgGame.Items.Weapon.