RpgGame
Console Based RPG game in C#
Loading...
Searching...
No Matches
RpgGame.Items.TwoHandOccupation Class Referencesealed

Represents a hand occupation strategy for two-handed equipment. More...

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

Public Member Functions

override bool EquipLeft (Player player, IEquippable item)
 Attempts to equip the item in the left hand. For two-handed items, this delegates to a shared method that occupies both hands.
 
override bool EquipRight (Player player, IEquippable item)
 Attempts to equip the item in the right hand. For two-handed items, this delegates to a shared method that occupies both hands.
 
- Public Member Functions inherited from RpgGame.Items.HandOccupation
bool EquipLeft (Player player, IEquippable item)
 Attempts to equip the specified item into the player's left hand.
 
bool EquipRight (Player player, IEquippable item)
 Attempts to equip the specified item into the player's right hand.
 

Detailed Description

Represents a hand occupation strategy for two-handed equipment.

The TwoHandOccupation class defines the behavior required to equip an item that occupies both the left and right hands.

This strategy ensures that both hands must be free before equipping the item. If either hand is already occupied, the equip operation fails.

This class is part of the equipment strategy system and helps eliminate the need for type checks or enumeration-based logic when determining how items are equipped.

Member Function Documentation

◆ EquipLeft()

override bool RpgGame.Items.TwoHandOccupation.EquipLeft ( Player  player,
IEquippable  item 
)
inline

Attempts to equip the item in the left hand. For two-handed items, this delegates to a shared method that occupies both hands.

Parameters
playerThe player attempting to equip the item.
itemThe item being equipped.
Returns
True if both hands were free and the item was successfully equipped; otherwise false.

◆ EquipRight()

override bool RpgGame.Items.TwoHandOccupation.EquipRight ( Player  player,
IEquippable  item 
)
inline

Attempts to equip the item in the right hand. For two-handed items, this delegates to a shared method that occupies both hands.

Parameters
playerThe player attempting to equip the item.
itemThe item being equipped.
Returns
True if both hands were free and the item was successfully equipped; otherwise false.

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