![]() |
Bridges-Java-3.0.1
3.0.1
Bridges(JavaAPI)
|
This is a class in BRIDGES for representing an (m x n) grid. Each position in the grid will hold a GameCell object, each of which has a foreground color, background color, and a symbol.
Public Member Functions | |
| void | setEncoding (String encoding) |
| Enable changing the game grid encoding when building JSON representation. More... | |
| String | getDataStructType () |
| GameGrid () | |
| GameGrid (int rows, int cols) | |
| void | setBGColor (Integer row, Integer col, NamedColor color) |
| NamedColor | getBGColor (Integer row, Integer col) |
| NamedSymbol | getSymbol (Integer row, Integer col) |
| NamedColor | getSymbolColor (Integer row, Integer col) |
| void | setFGColor (Integer row, Integer col, NamedColor color) |
| void | setBGColor (Integer row, Integer col, String color) |
| void | setFGColor (Integer row, Integer col, String color) |
| void | drawSymbol (Integer row, Integer col, Integer symbol) |
| void | drawSymbol (Integer row, Integer col, NamedSymbol symbol) |
| void | drawSymbol (Integer row, Integer col, Integer symbol, String color) |
| void | drawSymbol (Integer row, Integer col, NamedSymbol symbol, String color) |
| void | drawSymbol (Integer row, Integer col, Integer symbol, NamedColor color) |
| void | drawSymbol (Integer row, Integer col, NamedSymbol symbol, NamedColor color) |
| String | getDataStructureRepresentation () |
Public Member Functions inherited from bridges.base.Grid< GameCell > | |
| String | getDataStructType () |
| Grid () | |
| Grid (int size) | |
| Grid (int rows, int cols) | |
| Grid (int[] size) | |
| int [] | getDimensions () |
| E | get (Integer row, Integer col) |
| void | set (Integer row, Integer col, E val) |
| String | getDataStructureRepresentation () |
Additional Inherited Members | |
Protected Attributes inherited from bridges.base.Grid< GameCell > | |
| ArrayList< ArrayList< E > > | grid |
| int [] | gridSize |
Static Protected Attributes inherited from bridges.base.Grid< GameCell > | |
| static final int [] | defaultGridSize |
| static int [] | maxGridSize |
| bridges.base.GameGrid.GameGrid | ( | ) |
Default Game Grid constructor
| bridges.base.GameGrid.GameGrid | ( | int | rows, |
| int | cols | ||
| ) |
Grid constructor with grid size arguments
| rows | - int representing the number of rows of the grid |
| cols | - int representing the number of columns of the grid |
| void bridges.base.GameGrid.drawSymbol | ( | Integer | row, |
| Integer | col, | ||
| Integer | symbol | ||
| ) |
Draw a symbol at the specified location
| row,col | - integer indices specifying the position to modify |
| symbol | - Integer symbol argument to set the symbol at the chosen position |
| void bridges.base.GameGrid.drawSymbol | ( | Integer | row, |
| Integer | col, | ||
| NamedSymbol | symbol | ||
| ) |
Draw a symbol at the specified location
| row,col | - integer indices specifying the position to modify |
| symbol | - Named symbol enum argument to set the symbol at the chosen position |
| void bridges.base.GameGrid.drawSymbol | ( | Integer | row, |
| Integer | col, | ||
| Integer | symbol, | ||
| String | color | ||
| ) |
Draw a symbol at the specified location
| row,col | - integer indices specifying the position to modify |
| symbol | - Integer symbol argument to set the symbol at the chosen position |
| color | - String color argument to set the background at the chosen position |
| void bridges.base.GameGrid.drawSymbol | ( | Integer | row, |
| Integer | col, | ||
| NamedSymbol | symbol, | ||
| String | color | ||
| ) |
Draw a symbol at the specified location
| row,col | - integer indices specifying the position to modify |
| symbol | - Named Symbol enum argument to set the symbol at the chosen position |
| color | - String color argument to set the background at the chosen position |
| void bridges.base.GameGrid.drawSymbol | ( | Integer | row, |
| Integer | col, | ||
| Integer | symbol, | ||
| NamedColor | color | ||
| ) |
Draw a symbol at the specified location
| row,col | - integer indices specifying the position to modify |
| symbol | - Integer symbol argument to set the symbol at the chosen position |
| color | - Named Color enum argument to set the foreground at the chosen position |
| void bridges.base.GameGrid.drawSymbol | ( | Integer | row, |
| Integer | col, | ||
| NamedSymbol | symbol, | ||
| NamedColor | color | ||
| ) |
| NamedColor bridges.base.GameGrid.getBGColor | ( | Integer | row, |
| Integer | col | ||
| ) |
| String bridges.base.GameGrid.getDataStructType | ( | ) |
| String bridges.base.GameGrid.getDataStructureRepresentation | ( | ) |
get the JSON representation of the game grid. Contains separate foreground, background, and symbol arrays
| NamedSymbol bridges.base.GameGrid.getSymbol | ( | Integer | row, |
| Integer | col | ||
| ) |
| NamedColor bridges.base.GameGrid.getSymbolColor | ( | Integer | row, |
| Integer | col | ||
| ) |
| void bridges.base.GameGrid.setBGColor | ( | Integer | row, |
| Integer | col, | ||
| NamedColor | color | ||
| ) |
Set background color of a cell using an enum argument
| row,col | - integer indices specifying the position to modify |
| color | - Named Color enum argument to set the background at the chosen position |
| void bridges.base.GameGrid.setBGColor | ( | Integer | row, |
| Integer | col, | ||
| String | color | ||
| ) |
Set background color of a cell using an enum argument
| row,col | - integer indices specifying the position to modify |
| color | - String color argument to set the background at the chosen position |
| void bridges.base.GameGrid.setEncoding | ( | String | encoding | ) |
Enable changing the game grid encoding when building JSON representation.
| encoding | type of encoding. Supports "raw" and "rle" |
| void bridges.base.GameGrid.setFGColor | ( | Integer | row, |
| Integer | col, | ||
| NamedColor | color | ||
| ) |
Set foreground color of a cell using an enum argument
| row,col | - integer indices specifying the position to modify |
| color | - Named Color enum argument to set the foreground at the chosen position |
| void bridges.base.GameGrid.setFGColor | ( | Integer | row, |
| Integer | col, | ||
| String | color | ||
| ) |
Set background color of a cell using an enum argument
| row,col | - integer indices specifying the position to modify |
| color | - String color argument to set the background at the chosen position |
1.8.13