RpgGame
Console Based RPG game in C#
Loading...
Searching...
No Matches
RpgGame.Items.IEquippable Interface Reference

Represents an item that can be equipped by the player. More...

Inheritance diagram for RpgGame.Items.IEquippable:
Collaboration diagram for RpgGame.Items.IEquippable:

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.
 

Detailed Description

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.

Member Function Documentation

◆ TryEquipToLeft()

bool RpgGame.Items.IEquippable.TryEquipToLeft ( Player  player)

Attempts to equip the item in the player's left hand.

Parameters
playerThe player attempting to equip the item.
Returns
True if the item was successfully equipped in the left hand; otherwise false.

Implemented in RpgGame.Items.Weapon.

Here is the caller graph for this function:

◆ TryEquipToRight()

bool RpgGame.Items.IEquippable.TryEquipToRight ( Player  player)

Attempts to equip the item in the player's right hand.

Parameters
playerThe player attempting to equip the item.
Returns
True if the item was successfully equipped in the right hand; otherwise false.

Implemented in RpgGame.Items.Weapon.

Here is the caller graph for this function:

The documentation for this interface was generated from the following file: