|
| GameBase (int assid, String login, String apikey, int rows, int cols) |
|
| GameBase (int assid, String login, String apikey, int rows, int cols, boolean d) |
|
abstract void | start () |
| Call this function from main to start the game. More...
|
|
◆ GameBase() [1/2]
bridges.games.GameBase.GameBase |
( |
int |
assid, |
|
|
String |
login, |
|
|
String |
apikey, |
|
|
int |
rows, |
|
|
int |
cols |
|
) |
| |
◆ GameBase() [2/2]
bridges.games.GameBase.GameBase |
( |
int |
assid, |
|
|
String |
login, |
|
|
String |
apikey, |
|
|
int |
rows, |
|
|
int |
cols, |
|
|
boolean |
d |
|
) |
| |
◆ drawSymbol()
Draw a symbol on the game.
- Parameters
-
row | - row of the cell to draw the object on |
col | - column of the cell to draw the object on |
s | symbol representing the object |
c | color of the object |
◆ gameLoop()
abstract void bridges.games.GameBase.gameLoop |
( |
| ) |
|
|
abstractprotected |
This function is called once per frame of the game.
Students write this function. It will be called at each frame of the game.
◆ getBGColor()
NamedColor bridges.games.GameBase.getBGColor |
( |
int |
row, |
|
|
int |
col |
|
) |
| |
|
protected |
What color is this cell?
- Parameters
-
row | - row of the cell |
col | - column of the cell
|
◆ getBoardHeight()
int bridges.games.GameBase.getBoardHeight |
( |
| ) |
|
|
protected |
How tall is the Game Board?
- Returns
- the number of rows of the board
◆ getBoardWidth()
int bridges.games.GameBase.getBoardWidth |
( |
| ) |
|
|
protected |
How wide is the Game Board?
- Returns
- the number of columns of the board
◆ getSymbol()
NamedSymbol bridges.games.GameBase.getSymbol |
( |
int |
row, |
|
|
int |
col |
|
) |
| |
|
protected |
What object is in this cell?
- Parameters
-
row | - row of the cell |
col | - column of the cell
|
◆ getSymbolColor()
NamedColor bridges.games.GameBase.getSymbolColor |
( |
int |
row, |
|
|
int |
col |
|
) |
| |
|
protected |
What color is object in this cell?
- Parameters
-
row | - row of the cell |
col | - column of the cell
|
◆ initialize()
abstract void bridges.games.GameBase.initialize |
( |
| ) |
|
|
abstractprotected |
This function is called once when the game starts.
Students write this function. It will be called once at the begining of the game.
◆ quit()
void bridges.games.GameBase.quit |
( |
| ) |
|
|
protected |
Call this function to stop the game.
◆ registerKeypress()
register a new KeypressListener
Students should not have to call this function directly. The KeypressListener listener will get notified of all keypresses (up and down) that happens in the game.
- Parameters
-
kl | a KeypressListener to register |
◆ render()
void bridges.games.GameBase.render |
( |
| ) |
|
|
package |
Renders the game.
Student should not have to call this function directly. It is called automatically by Bridges.
◆ setBGColor()
void bridges.games.GameBase.setBGColor |
( |
int |
row, |
|
|
int |
col, |
|
|
NamedColor |
c |
|
) |
| |
|
protected |
Change the background color of a cell.
- Parameters
-
row | - row of the cell to set |
col | - column of the cell to set |
c | NamedColor to set |
◆ setDescription()
void bridges.games.GameBase.setDescription |
( |
String |
desc | ) |
|
|
protected |
Set a short description of the game.
- Parameters
-
desc | Description of the game |
◆ setTitle()
void bridges.games.GameBase.setTitle |
( |
String |
title | ) |
|
|
protected |
Set the title of the game.
- Parameters
-
◆ start()
abstract void bridges.games.GameBase.start |
( |
| ) |
|
|
abstract |
◆ terminateNetwork()
void bridges.games.GameBase.terminateNetwork |
( |
| ) |
|
|
protected |
terminal all network connections Note that it takes a minute for all threads to gracefully exit
◆ debug
boolean bridges.games.GameBase.debug = false |
|
protected |
◆ gameStarted
boolean bridges.games.GameBase.gameStarted = true |
|
protected |
The documentation for this class was generated from the following file:
- /home/erik/work/bridges/bridges-java/src/main/java/bridges/games/GameBase.java