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

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

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

Public Member Functions

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

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 gold item on the map.
 
- Properties inherited from RpgGame.Items.IItem

Detailed Description

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

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

Member Function Documentation

◆ GetDescription()

string RpgGame.Items.Gold.GetDescription ( )

Returns a short description of the coin.

Returns
A textual description of the item.

Implements RpgGame.Items.IItem.

◆ OnDrop()

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

Handles drop behavior for the gold item.

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

Gold cannot be dropped because it is consumed immediately upon pickup.

Implements RpgGame.Items.IItem.

◆ OnPickup()

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

Handles the pickup interaction for the gold item.

Parameters
playerThe player picking up the gold.
inventoryThe player's inventory object. This parameter is ignored for gold items.
Returns
Always returns true, as gold is immediately consumed and applied to the player.

Implements RpgGame.Items.IItem.

Property Documentation

◆ color

ConsoleColor RpgGame.Items.Gold.color
get

Gets the console color used to render the gold item on the map.

Implements RpgGame.Items.IItem.

◆ Name

string RpgGame.Items.Gold.Name
get

Gets the display name of the coin.

Implements RpgGame.Items.IItem.

◆ Symbol

char RpgGame.Items.Gold.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: