This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

Game Struct Reference

The Game struct gives essential information about the game. More...

#include <game.h>


Data Fields

int cell_size
 The size of each square on the board in pixels.

int board_wid
 The number of rows in the board.

int board_heit
 The number of columns in the board.

int num_pieces
 The number of types of pieces that the game uses. More...

char* colors
 An array which gives the colors for the squares of the board.

int* init_pos
 The initial position.

char*** pixmaps
 An array of pixmaps representing the pieces.

char* name
void (* game_init )()
 A pointer to the function that will be called when initializing the game.


Detailed Description

The Game struct gives essential information about the game.

Only information that must be provided by every game is declared here. Of course, there are many other variables and functions that can be used to customize the game. These must be set in the function game_init. The good thing is that you can get your game running first and only use new features as you need them.

Definition at line 156 of file game.h.


Field Documentation

int Game::board_heit
 

The number of columns in the board.

Definition at line 165 of file game.h.

int Game::board_wid
 

The number of rows in the board.

Definition at line 162 of file game.h.

int Game::cell_size
 

The size of each square on the board in pixels.

Definition at line 159 of file game.h.

char * Game::colors
 

An array which gives the colors for the squares of the board.

Definition at line 178 of file game.h.

void(* Game::game_init)()
 

A pointer to the function that will be called when initializing the game.

Referenced by engine_new_game(), parse_opts(), and ui_start_game().

int * Game::init_pos
 

The initial position.

Definition at line 181 of file game.h.

char* Game::name
 

Definition at line 186 of file game.h.

int Game::num_pieces
 

The number of types of pieces that the game uses.

(12 for chess (chess.c), for instance -- 6 white and 6 black). The maximum value is 127. In several games, like mastermind (mastermind.c), the value of num_pieces is more than the actual number of pieces that the user sees. This is because several logical pieces are mapped to the same image and the value of the piece is used to encode some state information about that square.

Definition at line 175 of file game.h.

char *** Game::pixmaps
 

An array of pixmaps representing the pieces.

Definition at line 184 of file game.h.


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