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

Base abstract class for both playable and non-playable characters. More...

Inheritance diagram for RpgGame.Character.Character:
Collaboration diagram for RpgGame.Character.Character:

Public Member Functions

void Move (Position newPos)
 Moves the character to a new position.
 

Protected Member Functions

 Character (Position startPosition)
 Initializes a new instance of the Character class.
 

Properties

char Symbol [get]
 Gets the character symbol used to render this character on the map.
 
Position Pos [get]
 Gets or sets the current position of the character in the level.
 

Detailed Description

Base abstract class for both playable and non-playable characters.

The Character class provides the foundation for all character types in the game. Character-derived classes must implement the Symbol property to define how they are rendered on the map. Position tracking and movement are handled by the base class.

Constructor & Destructor Documentation

◆ Character()

RpgGame.Character.Character.Character ( Position  startPosition)
inlineprotected

Initializes a new instance of the Character class.

Parameters
startPositionThe starting position for this character.

Member Function Documentation

◆ Move()

void RpgGame.Character.Character.Move ( Position  newPos)
inline

Moves the character to a new position.

Parameters
newPosThe new position to move to.

This method does not validate whether the target position is walkable. Movement validation should be performed by the caller.


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