|
RpgGame
Console Based RPG game in C#
|
Represents an item that can be equipped by the player. More...
Public Member Functions | |
| bool | TryEquipToLeft (Player player) |
| Attempts to equip the item in the player's left hand. | |
| bool | TryEquipToRight (Player player) |
| Attempts to equip the item in the player's right hand. | |
Public Member Functions inherited from RpgGame.Items.IItem | |
| 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. | |
Additional Inherited Members | |
Properties inherited from RpgGame.Items.IItem | |
| 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. | |
Represents an item that can be equipped by the player.
The IEquippable interface extends IItem and defines behavior specific to items that can occupy the player's hands.
Implementations determine whether equipping succeeds based on current equipment state and occupation rules. This abstraction enables polymorphic equipment handling without relying on type checks or enumerations.
| bool RpgGame.Items.IEquippable.TryEquipToLeft | ( | Player | player | ) |
Attempts to equip the item in the player's left hand.
| player | The player attempting to equip the item. |
Implemented in RpgGame.Items.Weapon.
| bool RpgGame.Items.IEquippable.TryEquipToRight | ( | Player | player | ) |
Attempts to equip the item in the player's right hand.
| player | The player attempting to equip the item. |
Implemented in RpgGame.Items.Weapon.