This is a class in BRIDGES for representing an (n x n)game grid.
More...
#include <GameGrid.h>
|
| void | setBGColor (int row, int col, NamedColor color) |
| |
| NamedColor | getBGColor (int row, int col) const |
| |
| NamedColor | getFGColor (int row, int col) const |
| |
| NamedSymbol | getSymbol (int row, int col) const |
| |
| void | setFGColor (int row, int col, NamedColor color) |
| |
| void | setSymbol (int row, int col, NamedSymbol symbol) |
| |
| void | drawSymbol (int row, int col, NamedSymbol symbol, NamedColor color) |
| |
| virtual const string | getDStype () const override |
| | Return the data structure type.
|
| |
| | GameGrid (int nbrow=10, int nbcol=10) |
| |
| | GameGrid (const GameGrid &)=delete |
| |
| virtual | ~GameGrid ()=default |
| |
| virtual const string | getDataStructureRepresentation () const override |
| |
| | Grid (int rows, int cols) |
| | Grid constructor.
|
| |
| | Grid () |
| |
| | Grid (int *size) |
| | Grid constructor given size.
|
| |
| | Grid (const Grid &g) |
| | Grid constructor given an input grid.
|
| |
| virtual | ~Grid () |
| |
| Grid & | operator= (const Grid &g) |
| |
| void | setDimensions (int rows, int cols) |
| | Construct the grid given the dimensions.
|
| |
| int const * | getDimensions () |
| | Get dimenions of the grid.
|
| |
| GameCell const & | get (int row, int col) const |
| | Get the (row, col) element in the grid.
|
| |
| void | set (int row, int col, GameCell val) |
| | Set the grid value for the (row, col) element.
|
| |
| BracketHelperConst | operator[] (int row) const |
| | provides the necessary abstraction to do something = grid[x][y];
|
| |
| BracketHelper | operator[] (int row) |
| | provides the necessary abstraction to do grid[x][y] = something;
|
| |
| virtual | ~DataStructure ()=default |
| |
This is a class in BRIDGES for representing an (n x n)game grid.
This class is part of the Bridges Game API
- See also
- See the detailed Bridges game tutorial for examples at https://bridgesuncc.github.io/tutorials/NonBlockingGame.html
- Author
- Erik Saule,
- Date
- 2018, 2019, 12/28/20
◆ GameGrid() [1/2]
| bridges::game::GameGrid::GameGrid |
( |
int |
nbrow = 10, |
|
|
int |
nbcol = 10 |
|
) |
| |
|
inline |
◆ GameGrid() [2/2]
| bridges::game::GameGrid::GameGrid |
( |
const GameGrid & |
| ) |
|
|
delete |
◆ ~GameGrid()
| virtual bridges::game::GameGrid::~GameGrid |
( |
| ) |
|
|
virtualdefault |
◆ drawSymbol()
Draw a symbol at the specified location
- Parameters
-
| row,col | - integer indices specifying the position to modify |
| symbol | Symbol to draw |
| color | Color to draw the symbol in |
◆ getBGColor()
| NamedColor bridges::game::GameGrid::getBGColor |
( |
int |
row, |
|
|
int |
col |
|
) |
| const |
|
inline |
◆ getDataStructureRepresentation()
| virtual const string bridges::game::GameGrid::getDataStructureRepresentation |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getDStype()
| virtual const string bridges::game::GameGrid::getDStype |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getFGColor()
| NamedColor bridges::game::GameGrid::getFGColor |
( |
int |
row, |
|
|
int |
col |
|
) |
| const |
|
inline |
◆ getSymbol()
| NamedSymbol bridges::game::GameGrid::getSymbol |
( |
int |
row, |
|
|
int |
col |
|
) |
| const |
|
inline |
◆ setBGColor()
| void bridges::game::GameGrid::setBGColor |
( |
int |
row, |
|
|
int |
col, |
|
|
NamedColor |
color |
|
) |
| |
|
inline |
Set background color of a cell using an enum argument
- Parameters
-
| row,col | - integer indices specifying the position to modify |
| color | - Named Color enum argument to set the background at the chosen position |
◆ setFGColor()
| void bridges::game::GameGrid::setFGColor |
( |
int |
row, |
|
|
int |
col, |
|
|
NamedColor |
color |
|
) |
| |
|
inline |
Set foreground color of a cell using an enum argument
- Parameters
-
| row,col | - integer indices specifying the position to modify |
| color | - Named Color enum argument to set the foreground at the chosen position |
◆ setSymbol()
| void bridges::game::GameGrid::setSymbol |
( |
int |
row, |
|
|
int |
col, |
|
|
NamedSymbol |
symbol |
|
) |
| |
|
inline |
Set the symbol of a cell using an enum argument
- Parameters
-
| row,col | - integer indices specifying the position to modify |
| symbol | - the symbol to set |
The documentation for this class was generated from the following file:
- /home/erik/work/bridges/bridges-cxx/src/GameGrid.h