15Slide
|
A data type consisting of a 4 by 4 grid array, and a 16 by 2 index, for use with 15Slide. More...
#include <Grid.h>
Public Types | |
typedef std::array< std::array< std::uint8_t, 4 >, 4 > | gridArray_t |
The type used for Grid::gridArray. More... | |
typedef std::array< std::array< std::uint8_t, 2 >, 16 > | index_t |
The type used for Grid::index. More... | |
Public Member Functions | |
Grid () | |
Creates a new Grid, leaving everything uninitialized. More... | |
Grid (const gridArray_t &newGrid) | |
Creates a new Grid and copies a grid array to it. More... | |
Grid (const index_t &newIndex) | |
Creates a new Grid and copies an index to it. More... | |
Grid (const gridArray_t &newGrid, const index_t &newIndex) | |
Creates a new Grid and copies a grid array and an index to it. More... | |
Grid (const Grid &other) | |
Creates and copies a new Grid. More... | |
Grid & | operator= (const Grid &other) |
Copies a Grid. More... | |
void | setGridArray (const gridArray_t &newGrid) |
Sets Grid::grid. More... | |
void | setGrid (const Grid &newGrid) |
Copies a Grid. More... | |
void | setIndex (const index_t &newIndex) |
Sets Grid::index. More... | |
Public Attributes | |
gridArray_t | gridArray {} |
The grid. More... | |
index_t | index {} |
The index to keep track of tile locations. More... | |
Static Public Attributes | |
static constexpr std::size_t | NO_TILE {0} |
The number representing the lack of a tile. More... | |
static constexpr std::size_t | TILE_MAX {15} |
The maximum tile number. More... | |
static constexpr std::size_t | TILE_MIN {0} |
The mininum tile number. More... | |
static constexpr std::size_t | Y_MAX {3} |
The maximum y coordinate. More... | |
static constexpr std::size_t | Y_MIN {0} |
The mininum x coordinate. More... | |
static constexpr std::size_t | X_MAX {3} |
The maximum x coordinate. More... | |
static constexpr std::size_t | X_MIN {0} |
The mininum x coordinate. More... | |
static constexpr gridArray_t | GOAL_GRID |
How the gridArray should be when the game is won. More... | |
A data type consisting of a 4 by 4 grid array, and a 16 by 2 index, for use with 15Slide.
typedef std::array<std::array<std::uint8_t, 4>, 4> Grid15::Grid::gridArray_t |
The type used for Grid::gridArray.
typedef std::array<std::array<std::uint8_t, 2>, 16> Grid15::Grid::index_t |
The type used for Grid::index.
Grid15::Grid::Grid | ( | ) |
Creates a new Grid, leaving everything uninitialized.
Grid15::Grid::Grid | ( | const gridArray_t & | newGrid | ) |
Creates a new Grid and copies a grid array to it.
newGrid | The new grid array |
Grid15::Grid::Grid | ( | const index_t & | newIndex | ) |
Creates a new Grid and copies an index to it.
newIndex | The new index |
Grid15::Grid::Grid | ( | const gridArray_t & | newGrid, |
const index_t & | newIndex | ||
) |
Creates a new Grid and copies a grid array and an index to it.
newGrid | The new grid array |
newIndex | The new index |
Grid15::Grid::Grid | ( | const Grid & | newGrid | ) |
void Grid15::Grid::setGridArray | ( | const gridArray_t & | newGrid | ) |
Sets Grid::grid.
newGrid | The new grid array to use |
void Grid15::Grid::setIndex | ( | const index_t & | newIndex | ) |
Sets Grid::index.
newIndex | The new index array to use |
|
static |
How the gridArray should be when the game is won.
gridArray_t Grid15::Grid::gridArray {} |
The grid.
index_t Grid15::Grid::index {} |
The index to keep track of tile locations.
|
static |
The number representing the lack of a tile.
|
static |
The maximum tile number.
|
static |
The mininum tile number.
|
static |
The maximum x coordinate.
|
static |
The mininum x coordinate.
|
static |
The maximum y coordinate.
|
static |
The mininum x coordinate.