Sista v3.0.0-alpha.1
Sista is a C++ lightweight OS-agnostic library for terminal animations and videogames
Loading...
Searching...
No Matches
pawn.hpp
Go to the documentation of this file.
1
16#pragma once
17
18#include "ansi.hpp"
19#include "coordinates.hpp"
20
21namespace sista {
37 class Pawn {
38 protected:
39 char symbol;
43 public:
50 Pawn(char, const Coordinates&, const ANSISettings&);
52 virtual ~Pawn() {}
53
57 void setCoordinates(const Coordinates&);
61 void getCoordinates(Coordinates&) const;
66
70 void setSettings(const ANSISettings&);
74 void getSettings(ANSISettings&) const;
79
85 void setSymbol(char);
89 char getSymbol() const;
90
99 virtual void print() const;
100 };
101};
ANSI escape code utilities and types for terminal formatting.
Represents an object on the field with a symbol, coordinates, and ANSI settings.
Definition: pawn.hpp:37
virtual void print() const
Prints the pawn to the terminal with its associated ANSI settings.
Definition: pawn.cpp:47
void setSymbol(char)
Sets the symbol of the pawn.
Definition: pawn.cpp:40
Coordinates getCoordinates() const
Gets the coordinates of the pawn.
Definition: pawn.cpp:26
ANSISettings getSettings() const
Gets the ANSI settings of the pawn.
Definition: pawn.cpp:36
Coordinates coordinates
Definition: pawn.hpp:40
char symbol
Definition: pawn.hpp:39
void setCoordinates(const Coordinates &)
Sets the coordinates of the pawn.
Definition: pawn.cpp:20
ANSISettings settings
Definition: pawn.hpp:41
void setSettings(const ANSISettings &)
Sets the ANSI settings of the pawn.
Definition: pawn.cpp:30
char getSymbol() const
Gets the symbol of the pawn.
Definition: pawn.cpp:43
virtual ~Pawn()
Virtual destructor.
Definition: pawn.hpp:52
Coordinates struct header file.
Sista library namespace.
Definition: ansi.cpp:25
Represents a set of ANSI settings including colors and attributes.
Definition: ansi.hpp:367
Represents 2D coordinates with x and y values.
Definition: coordinates.hpp:31