MiniGame-Madness
|
A struct that represents a chess square. More...
#include <Chess.h>
Public Member Functions | |
ChessSquare (SquareColour squareColour) | |
Default constructor for ChessSquare. More... | |
ChessSquare (PieceType type, PlayerColour playerColour, SquareColour squareColour) | |
Constructor for ChessSquare. More... | |
void | addNeighbor (ChessSquare *square, Direction direction) |
Add a neighboring square with a direction. More... | |
bool | removeNeighbor (Direction direction) |
Remove a neighboring square with a direction. More... | |
ChessSquare * | getNeighbor (Direction direction) const |
Get the neighboring square in a given direction. More... | |
std::map< Direction, ChessSquare * > | getNeighbors () const |
Get all neighboring squares. More... | |
PieceType | getPieceType () const |
Get the piece type of the square. More... | |
bool | setPieceType (PieceType type) |
Set the piece type of the square. More... | |
PlayerColour | getPlayerColour () const |
Get the player color of the square. More... | |
bool | setPlayerColour (PlayerColour playerColour) |
Set the player color of the square. More... | |
SquareColour | getSquareColour () const |
Get the square colour of the square. More... | |
Public Attributes | |
PieceType | type |
PlayerColour | playerColour |
SquareColour | squareColour |
std::map< Direction, ChessSquare * > | neighbors |
A struct that represents a chess square.
This struct contains the type of the piece and the color of the player that owns the piece as well as colour of the square.
The default type is EMPTY and the default player color is BLANK reprasenting an emptry square.
|
inline |
Default constructor for ChessSquare.
Initializes the ChessSquare with an EMPTY type, a BLANK player color.
squareColour | The Colour of the square. |
|
inline |
Constructor for ChessSquare.
Initializes the ChessSquare with the given type, player color, and square colour.
type | The type of the piece. |
playerColour | The color of the player that owns the piece. |
squareColour | The color of the square. |
|
inline |
Add a neighboring square with a direction.
square | - The square to add as a neighbor. |
direction | - The direction of the neighboring square. |
|
inline |
Get the neighboring square in a given direction.
direction | - The direction of the neighboring square. |
|
inline |
Get all neighboring squares.
|
inline |
Get the piece type of the square.
|
inline |
Get the player color of the square.
|
inline |
Get the square colour of the square.
|
inline |
Remove a neighboring square with a direction.
direction | - The direction of the neighboring square. |
|
inline |
Set the piece type of the square.
type | - The piece type to set. |
|
inline |
Set the player color of the square.
playerColour | - The player color to set. |
std::map<Direction, ChessSquare*> ChessSquare::neighbors |
A map of directions to neighboring squares.
PlayerColour ChessSquare::playerColour |
The color of the player that owns the piece.
SquareColour ChessSquare::squareColour |
The color of the square.
PieceType ChessSquare::type |
The type of the piece.