RpgGame
Console Based RPG game in C#
Loading...
Searching...
No Matches
RpgGame.Character Namespace Reference

Classes

class  Character
 Base abstract class for both playable and non-playable characters. More...
 
class  Golem
 Represents a Golem character in the game. Golems are typically non-player characters (NPCs) that may serve as enemies. More...
 
class  Player
 Represents the player-controlled character in the game. More...
 

Functions

readonly record struct Position (int X, int Y)
 A record for tracking the position of Characters, Items, and Tiles if needed.
 

Function Documentation

◆ Position()

readonly record struct RpgGame.Character.Position ( int  X,
int  Y 
)

A record for tracking the position of Characters, Items, and Tiles if needed.

Parameters
XThe horizontal coordinate (0-based from left).
YThe vertical coordinate (0-based from top).

Position is represented as a readonly record struct for immutability and value semantics. Supports arithmetic operations for convenient coordinate manipulation.

Returns a new Position offset by the specified amounts.

Parameters
dxHorizontal offset.
dyVertical offset.
Returns
A new Position with the applied offset.

Adds two positions component-wise.

Subtracts one position from another component-wise.

Multiplies a position by a scalar value.

Here is the call graph for this function:
Here is the caller graph for this function: