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

Represents a consumable health potion. More...

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

Public Member Functions

string GetDescription ()
 Returns a description of the potion's effect.
 
bool OnPickup (Player player, Inventory inventory)
 Called when the player picks up the potion. Restores health immediately.
 
void OnDrop (Level level, Player player)
 Called when the potion is dropped. Potions are auto-consumed and cannot be dropped.
 

Properties

string Name [get]
 Gets the name of the potion.
 
char Symbol [get]
 Gets the character symbol representing the potion on the map.
 
ConsoleColor color [get]
 Gets the color of the potion when rendered.
 
- Properties inherited from RpgGame.Items.IItem

Detailed Description

Represents a consumable health potion.

Member Function Documentation

◆ GetDescription()

string RpgGame.Items.Potion.GetDescription ( )

Returns a description of the potion's effect.

Returns
A string describing the potion.

Implements RpgGame.Items.IItem.

◆ OnDrop()

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

Called when the potion is dropped. Potions are auto-consumed and cannot be dropped.

Parameters
levelThe current level.
playerThe player dropping the potion.

Implements RpgGame.Items.IItem.

◆ OnPickup()

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

Called when the player picks up the potion. Restores health immediately.

Parameters
playerThe player picking up the potion.
inventoryThe player's inventory (not used as the potion is consumed).
Returns
True, as the potion is consumed immediately.

Implements RpgGame.Items.IItem.

Here is the call graph for this function:

Property Documentation

◆ color

ConsoleColor RpgGame.Items.Potion.color
get

Gets the color of the potion when rendered.

Implements RpgGame.Items.IItem.

◆ Name

string RpgGame.Items.Potion.Name
get

Gets the name of the potion.

Implements RpgGame.Items.IItem.

◆ Symbol

char RpgGame.Items.Potion.Symbol
get

Gets the character symbol representing the potion on the map.

Implements RpgGame.Items.IItem.


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