Bridges-Python  3.4.4
Bridges(Python API)
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
bridges.grid.Grid Class Reference
Inheritance diagram for bridges.grid.Grid:
bridges.color_grid.ColorGrid bridges.game_grid.GameGrid

Detailed Description

This is a base class in BRIDGES for representing an (n x n) grid.

Author
David Burlinson, Matthew McQuaigue
Date
2018, 7/24/19, 2021
See also
Color grid tutorial at https://bridgesuncc.github.io/tutorials/Grid.html

Public Member Functions

str get_data_structure_type (self)
 Get the data structure type. More...
 
None __init__ (self, **kwargs)
 Grid constructor. More...
 
list dimensions (self)
 Getter for the dimensions of the grid. More...
 
def get (self, int row, int col)
 Get the row,col element in the grid. More...
 
None set (self, int row, int col, val)
 set the (row, col) element in the grid More...
 

Public Attributes

 grid
 

Static Public Attributes

list grid_size = [10, 10]
 
list maxGridSize = [1080, 1920]
 

Constructor & Destructor Documentation

◆ __init__()

None bridges.grid.Grid.__init__ (   self,
**  kwargs 
)

Grid constructor.

Parameters
sizesize of the grid as array
rowsnumber of rows in grid
colsnumber of the columns in grid
Returns
None
Exceptions
ValueErrorif the size dimensions are greater than the max grid sizes (1080, 1920)

Member Function Documentation

◆ dimensions()

list bridges.grid.Grid.dimensions (   self)

Getter for the dimensions of the grid.

Returns
list as the dimensions of the grid

◆ get()

def bridges.grid.Grid.get (   self,
int  row,
int  col 
)

Get the row,col element in the grid.

       (int) row: row the element is in
       (int) col: col the element is in
Returns
element
none
Raises
Exception printing the traceback stack if returning the row and column is an error

◆ get_data_structure_type()

str bridges.grid.Grid.get_data_structure_type (   self)

Get the data structure type.

Returns
str representing the data structure type

Reimplemented in bridges.game_grid.GameGrid, and bridges.color_grid.ColorGrid.

◆ set()

None bridges.grid.Grid.set (   self,
int  row,
int  col,
  val 
)

set the (row, col) element in the grid

Parameters
rowrow position
colcolumn position
valvalue to be set in (row, col) position
Returns
None
Exceptions
Exceptionif setting the element at the row and column is a problem

Member Data Documentation

◆ grid

bridges.grid.Grid.grid

◆ grid_size

list bridges.grid.Grid.grid_size = [10, 10]
static

◆ maxGridSize

list bridges.grid.Grid.maxGridSize = [1080, 1920]
static

The documentation for this class was generated from the following file: