RpgGame
Console Based RPG game in C#
Loading...
Searching...
No Matches
RpgGame.Items.Coin Class Reference

Represents a coin item that increases the player's currency when picked up. More...

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

Public Member Functions

string GetDescription ()
 Returns a short description of the coin.
 
bool OnPickup (Player player, Inventory inventory)
 Handles the pickup interaction for the coin.
 
void OnDrop (Level level, Player player)
 Handles drop behavior for the coin.
 

Properties

string Name [get]
 Gets the display name of the coin.
 
char Symbol [get]
 Gets the character symbol used to render the coin on the map.
 
ConsoleColor color [get]
 Gets the console color used to render the Coin on the map.
 
- Properties inherited from RpgGame.Items.IItem

Detailed Description

Represents a coin item that increases the player's currency when picked up.

Coins are automatically consumed upon pickup and are not stored in the player's inventory. The pickUpLeft parameter is accepted to conform to the item interaction signature, although it has no effect on coin behavior.

Member Function Documentation

◆ GetDescription()

string RpgGame.Items.Coin.GetDescription ( )

Returns a short description of the coin.

Returns
A textual description of the item.

Implements RpgGame.Items.IItem.

◆ OnDrop()

void RpgGame.Items.Coin.OnDrop ( Level  level,
Player  player 
)
inline

Handles drop behavior for the coin.

Parameters
levelThe current level.
playerThe player attempting to drop the coin.

Coins cannot be dropped because they are consumed immediately upon pickup.

Implements RpgGame.Items.IItem.

◆ OnPickup()

bool RpgGame.Items.Coin.OnPickup ( Player  player,
Inventory  inventory 
)
inline

Handles the pickup interaction for the coin.

Parameters
playerThe player picking up the coin.
pickUpLeftIndicates whether the pickup interaction was initiated for the left hand. This parameter is ignored for coins.
Returns
Always returns true, as coins are immediately consumed and applied to the player.

Implements RpgGame.Items.IItem.

Here is the call graph for this function:

Property Documentation

◆ color

ConsoleColor RpgGame.Items.Coin.color
get

Gets the console color used to render the Coin on the map.

Implements RpgGame.Items.IItem.

◆ Name

string RpgGame.Items.Coin.Name
get

Gets the display name of the coin.

Implements RpgGame.Items.IItem.

◆ Symbol

char RpgGame.Items.Coin.Symbol
get

Gets the character symbol used to render the coin on the map.

Implements RpgGame.Items.IItem.


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