Sista v3.1.0
C++ lightweight OS-agnostic library for terminal animations and videogames
Loading...
Searching...
No Matches
pawn.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2022-2026 FLAK-ZOSO <mattia.marchese.2006@gmail.com>
3 * SPDX-License-Identifier: GPL-3.0-only
4 */
5
21#pragma once
22
23#include "ansi.hpp"
24#include "coordinates.hpp"
25
26namespace sista {
42 class Pawn {
43 protected:
44 char symbol;
48 public:
55 Pawn(char, const Coordinates&, const ANSISettings&);
57 virtual ~Pawn() {}
58
62 void setCoordinates(const Coordinates&);
66 void getCoordinates(Coordinates&) const;
71
75 void setSettings(const ANSISettings&);
79 void getSettings(ANSISettings&) const;
84
90 void setSymbol(char);
94 char getSymbol() const;
95
104 virtual void print() const;
105 };
106};
ANSI escape code utilities and types for terminal formatting.
Class representing a Pawn owned by a Field or SwappableField.
Definition pawn.hpp:42
virtual void print() const
Prints the pawn to the terminal with its associated ANSI settings.
Definition pawn.cpp:52
void setSymbol(char)
Sets the symbol of the pawn.
Definition pawn.cpp:45
Coordinates getCoordinates() const
Gets the coordinates of the pawn.
Definition pawn.cpp:31
ANSISettings getSettings() const
Gets the ANSI settings of the pawn.
Definition pawn.cpp:41
Coordinates coordinates
Definition pawn.hpp:45
char symbol
Definition pawn.hpp:44
void setCoordinates(const Coordinates &)
Sets the coordinates of the pawn.
Definition pawn.cpp:25
ANSISettings settings
Definition pawn.hpp:46
void setSettings(const ANSISettings &)
Sets the ANSI settings of the pawn.
Definition pawn.cpp:35
char getSymbol() const
Gets the symbol of the pawn.
Definition pawn.cpp:48
virtual ~Pawn()
Virtual destructor.
Definition pawn.hpp:57
Coordinates struct header file.
Sista library namespace.
Definition ansi.cpp:31
Represents a set of ANSI settings including colors and attributes.
Definition ansi.hpp:492
Represents 2D coordinates with x and y values.
Definition coordinates.hpp:36