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

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

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

Public Member Functions

override bool EquipLeft (Player player, IEquippable item)
 Attempts to equip the item in the player's left hand.
 
override bool EquipRight (Player player, IEquippable item)
 Attempts to equip the item in the player's right hand.
 
- 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 one-handed equipment.

The OneHandOccupation class defines the behavior for items that occupy only a single hand when equipped.

This strategy allows a weapon to be equipped independently in either the left or right hand, provided that the selected hand is currently unoccupied.

This class is part of the equipment strategy system and works in conjunction with HandOccupation to remove the need for conditional logic or type checking when equipping items.

Member Function Documentation

◆ EquipLeft()

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

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

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

◆ EquipRight()

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

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

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

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