Bridges-Java  3.4.2
Bridges(Java API)
Public Member Functions | Static Protected Attributes | Package Attributes | List of all members
bridges.base.GameCell Class Reference

Detailed Description

This class is used to represent cells in GameGrid in BRIDGES. It is part of the GameAPI. Each cell has a foreground color, background color, and a symbol shape.

See also
See the tutorial on making games in BRIDGES: https://bridgesuncc.github.io/tutorials/NonBlockingGame.html
Author
David Burlinson
Date
9/06/18

Public Member Functions

 GameCell ()
 
 GameCell (NamedColor bg, NamedColor fg, NamedSymbol symbol)
 
void setBGColor (NamedColor bg)
 
void setFGColor (NamedColor fg)
 
void setBGColor (String bg)
 
void setFGColor (String fg)
 
void setSymbol (int s)
 
void setSymbol (NamedSymbol s)
 
NamedColor getBGColor ()
 Get the background color of cell. More...
 
NamedColor getFGColor ()
 Get the foreground color of cell. More...
 
NamedSymbol getSymbol ()
 Get the cell symbol. More...
 
byte getBGByte ()
 Get background color as a byte. More...
 
byte getFGByte ()
 Get foreground color as a byte. More...
 
byte getSymbolByte ()
 Get symbol as a byte. More...
 

Static Protected Attributes

static NamedSymbol[] symbolArray = NamedSymbol.values()
 

Package Attributes

NamedColor fg
 

Constructor & Destructor Documentation

◆ GameCell() [1/2]

bridges.base.GameCell.GameCell ( )

Default Constructor

◆ GameCell() [2/2]

bridges.base.GameCell.GameCell ( NamedColor  bg,
NamedColor  fg,
NamedSymbol  symbol 
)

Constructor with all arguments specified

Parameters
bg,fg- background, foreground Colors from the NamedColor enum
symbol- symbol index from range 0-255

Member Function Documentation

◆ getBGByte()

byte bridges.base.GameCell.getBGByte ( )

Get background color as a byte.

Returns
background color as byte (index of value in NamedColor)

◆ getBGColor()

NamedColor bridges.base.GameCell.getBGColor ( )

Get the background color of cell.

Returns
background color

◆ getFGByte()

byte bridges.base.GameCell.getFGByte ( )

Get foreground color as a byte.

Returns
foreground color as byte (index of value in NamedColor)

◆ getFGColor()

NamedColor bridges.base.GameCell.getFGColor ( )

Get the foreground color of cell.

Returns
object color

◆ getSymbol()

NamedSymbol bridges.base.GameCell.getSymbol ( )

Get the cell symbol.

Returns
symbol

◆ getSymbolByte()

byte bridges.base.GameCell.getSymbolByte ( )

Get symbol as a byte.

Returns
symbol as byte

◆ setBGColor() [1/2]

void bridges.base.GameCell.setBGColor ( NamedColor  bg)

Set background color using NamedColor Enum argument

Parameters
bg- Named Color from the NamedColor enum

◆ setBGColor() [2/2]

void bridges.base.GameCell.setBGColor ( String  bg)

Set background color using String argument

Parameters
bg- String background color

◆ setFGColor() [1/2]

void bridges.base.GameCell.setFGColor ( NamedColor  fg)

Set foreground color using NamedColor Enum argument

Parameters
fg- Named Color from the NamedColor enum

◆ setFGColor() [2/2]

void bridges.base.GameCell.setFGColor ( String  fg)

Set foreground color using String argument

Parameters
fg- String foreground color

◆ setSymbol() [1/2]

void bridges.base.GameCell.setSymbol ( int  s)

Set symbol using int argument

Parameters
s- Integer symbol index

◆ setSymbol() [2/2]

void bridges.base.GameCell.setSymbol ( NamedSymbol  s)

Set symbol using int argument

Parameters
s- Named symbol

Member Data Documentation

◆ fg

NamedColor bridges.base.GameCell.fg
package

◆ symbolArray

NamedSymbol [] bridges.base.GameCell.symbolArray = NamedSymbol.values()
staticprotected

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