RpgGame
Console Based RPG game in C#
Loading...
Searching...
No Matches
RpgGame.Items.HandOccupation Class Referenceabstract

Defines the strategy for how an equippable item occupies the player's hands. More...

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

Public Member Functions

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

Defines the strategy for how an equippable item occupies the player's hands.

The HandOccupation abstraction encapsulates the logic that determines how an item is equipped. Concrete implementations define whether an item occupies one hand or both hands.

This design follows the Strategy Pattern, allowing equipment behavior to vary independently from the Weapon class without relying on type checks or enumerations.

Implementations must define how equipping behaves when targeting the left or right hand.

Member Function Documentation

◆ EquipLeft()

bool RpgGame.Items.HandOccupation.EquipLeft ( Player  player,
IEquippable  item 
)
abstract

Attempts to equip the specified item into the player's left hand.

Parameters
playerThe player attempting to equip the item.
itemThe equippable item.
Returns
True if the item was successfully equipped; otherwise false.

◆ EquipRight()

bool RpgGame.Items.HandOccupation.EquipRight ( Player  player,
IEquippable  item 
)
abstract

Attempts to equip the specified item into the player's right hand.

Parameters
playerThe player attempting to equip the item.
itemThe equippable item.
Returns
True if the item was successfully equipped; otherwise false.

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