ow_game Class Reference

#include <ow_game.h>

List of all members.

Public Member Functions

 ow_game ()
void ow_setcommandlinehandlers (rl_vcpfunc_t *commhandler, rl_vcpfunc_t *commhandler_null, rl_completion_func_t *commhandler_completion, rl_compentry_func_t *commhandler_command, rl_compignore_func_t *commhandler_savegames_filter)
char ** commandline_completion (const char *text, int start, int end)
char * commandline_command_generator (const char *text, int state)
int commandline_savegames_filter (char **matches)
void commandline_read ()
void commandline_parse_execute (char *command)
string ow_commandline_translate_coord2name (int boardside, int cellx, int celly)
int ow_commandline_setupboard_put (parsed_command *pcommand)
int ow_commandline_setupboard_take (parsed_command *pcommand)
void ow_commandline_showgameconfig (parsed_command *pcommand)
int getnewgame_fromqueue ()
int selplayer_getboardside ()
int selplayer_makemovement (int boardside, int cellx, int celly)
int selplayer_rcapture (int boardside, int cellx, int celly)
int selplayer_getaimode ()
int selplayer_aimove_found ()
ow_move selplayer_aimove ()
int selplayer_endofturn ()
int board_endofturn ()
void board_update_status ()
string board_translate_coord2name (int boardside, int cellx, int celly)
void changeturn ()
int gamerunning ()
int gamecreated ()
int gameplaying ()
int gamesettingup ()
void rungame ()
int checkgamewon ()
void show_version ()
void draw_gfx ()
int MouseLeftButtonClicked (int *mouse_x, int *mouse_y)
int MouseRightButtonClicked (int *mouse_x, int *mouse_y)
ow_move seleccionarcelda_bycoord (int coordx, int coordy)
 ~ow_game ()

Private Member Functions

void logmove (int turn, ow_player *player, int boardside, int cellx, int celly)
void logrcapture (int turn, ow_player *player, int boardside, int cellx, int celly)
int ow_commandline_showlogmoves (parsed_command *pcommand)
int loggameresults ()
int ow_commandline_setlogresults (parsed_command *pcommand)
int undolastmove (int nummoves)
int redolastundo (int nummoves)
void commandline_parse_command (char *command, parsed_command *pcommand)
void ow_commandline_getpromptstring (char *prompt)
void ow_commandline_refreshprompt ()
int ow_commandline_newgame (parsed_command *pcommand)
int ow_commandline_loadgame (parsed_command *pcommand)
int ow_commandline_savegame (parsed_command *pcommand)
int ow_commandline_setupboard (parsed_command *pcommand)
int ow_commandline_setupboard_confirm (parsed_command *pcommand)
int ow_commandline_setupboard_cancel (parsed_command *pcommand)
int ow_commandline_endgame (parsed_command *pcommand)
void ow_commandline_version (parsed_command *pcommand)
int ow_commandline_quit (parsed_command *pcommand)
void ow_commandline_help (parsed_command *pcommand)
int ow_commandline_play (parsed_command *pcommand)
int ow_commandline_batch (parsed_command *pcommand)
int ow_commandline_setbatch (parsed_command *pcommand)
void ow_commandline_showtxtboard (parsed_command *pcommand)
int ow_commandline_setvalue (parsed_command *pcommand)
int ow_commandline_setnextturn (string variablename, string playerIDstr)
int ow_commandline_setnumcols (string numcols)
int ow_commandline_setplayer_aimode (string player_ai, string aimode)
int ow_commandline_setplayer_aidepth (string player_ai, string aidepth)
int ow_commandline_setplayer_aieval (string player_ai, string aieval)
int ow_commandline_setgfxboard_status (string gfxstatus)
int ow_commandline_creategame (parsed_command *pcommand)
void ow_commandline_setcommand_help (parsed_command *pcommand)
int ow_commandline_move (parsed_command *pcommand)
int ow_commandline_rcapture (parsed_command *pcommand)
int ow_commandline_manageai (parsed_command *pcommand)
int ow_commandline_mainmenu (parsed_command *pcommand)
cellXY ow_commandline_translate_name2coord (string cellname)
void createnewgame_useconfig ()
void set_default_gameconfig (game_configuration *config)
int loadgame (string filename)
int savegame (string filename)
int setupboard_fromarray (int arraydata[BRD_MAX_COLS_PER_PLAYER][(BRD_MAX_ROWS_PER_PLAYER *BRD_NUM_SIDES)])
void setnewturn (ow_player *player)
void setfirstturn (ow_player *player)
int load_gfxdata ()
int gfxboard_showhidde ()
void draw ()
void endgame ()
void exitomweso ()
int ow_commandline_undolastmove (parsed_command *pcommand)
int ow_commandline_redolastmove (parsed_command *pcommand)
int ow_commandline_undolastturn (parsed_command *pcommand)

Private Attributes

game_configuration config
int status
int current_turn
int current_menu
int queue_pos
int queue_last
int gfxboard_hidden
int gfxboard_dataloaded
SDL_Surface * gfxboard_screen
SDL_Surface * gfxdata [2]
TTF_Font * font
ow_playerp1
ow_playerp2
ow_boardowtab
ow_playerselected_player
rl_vcpfunc_t * commandline_handler
rl_vcpfunc_t * commandline_handler_null
rl_completion_func_t * commandline_completion_handler
rl_compentry_func_t * commandline_command_generator_handler
rl_compignore_func_t * commandline_savegames_filter_handler
logm_step logmoves [BRD_MAX_UNDO_MOVES]
int logmovescurrent
int logmovescount
string logresults
string logresultsfile


Detailed Description

Author:
David Torres <aiken669@gmail.com>

Constructor & Destructor Documentation

ow_game::ow_game (  ) 

Creates a new 'ow_game' object, with the default values.

Returns:
New 'ow_game' object.

ow_game::~ow_game (  ) 

Deletes an existing 'ow_game' object, including its related resources.


Member Function Documentation

void ow_game::logmove ( int  turn,
ow_player player,
int  boardside,
int  cellx,
int  celly 
) [private]

Write 'move' info to a log file specified by owgame->config.logmovesfile

Parameters:
player Player that made the movement.
boardside Side of the board (BRD_SIDE_NORTH, BRD_SIDE_SOUTH).
cellx Xpos of the specified cell in the board bcells array.
celly Ypos of the specified cell in the board bcells array.

void ow_game::logrcapture ( int  turn,
ow_player player,
int  boardside,
int  cellx,
int  celly 
) [private]

Write 'rcapture' info to a log file specified by owgame->config.logmovesfile

Parameters:
player Player that made the movement.
boardside Side of the board (BRD_SIDE_NORTH, BRD_SIDE_SOUTH).
cellx Xpos of the specified cell in the board bcells array.
celly Ypos of the specified cell in the board bcells array.

int ow_game::ow_commandline_showlogmoves ( parsed_command *  pcommand  )  [private]

Show the list of moves recently executed. It is used by UnDo/ReDo commands.

Parameters:
pcommand Command showlog and parameters (none) for the 'logm' command.
Returns:
Number of moves saved in the logmoves list.

int ow_game::loggameresults (  )  [private]

Save the game results to the results log, when one of the players wins the current game.

int ow_game::ow_commandline_setlogresults ( parsed_command *  pcommand  )  [private]

Sets the logresults file preferences. De/Activates saving results to a logfile, and additionally setups the logfile name.

Parameters:
pcommand Command parameters (param1=ON|OFF, param2=logfilename).
Returns:
0 on sucess, -1 on any error

int ow_game::undolastmove ( int  nummoves  )  [private]

UnDo the last (nummoves) movement(s) executed

Parameters:
nummoves Number of moves to UnDo.
Returns:
-1 on fail, nummoves on success

int ow_game::redolastundo ( int  nummoves  )  [private]

ReDo the last move 'undone' by the 'undom' command.

Parameters:
nummoves Number of moves to ReDo, if available.
Returns:
-1 on fail, Number of moves ReDone on success

void ow_game::commandline_parse_command ( char *  command,
parsed_command *  pcommand 
) [private]

Parses the command line received, generating a parsed command to execute.

Parameters:
command Command line to parse.
pcommand pointer to the variable to hold the parsed command data (parameters,etc)

void ow_game::ow_commandline_getpromptstring ( char *  prompt  )  [private]

Generates a different prompt string depending on the status or menu of the app where you are.

Parameters:
prompt Pointer to the variable to hold the new prompt string. The variable has to have room enought to hold generated string.

void ow_game::ow_commandline_refreshprompt (  )  [private]

Refresh the commandline prompt display

int ow_game::ow_commandline_newgame ( parsed_command *  pcommand  )  [private]

Goes into the 'create new game' configuration screen/menu.

Parameters:
pcommand Command info and parameters (none) for the 'newgame' command.
Returns:
1 on success, -1 on any error

int ow_game::ow_commandline_loadgame ( parsed_command *  pcommand  )  [private]

Load a game into the current game, from the file specified as second parameter

Parameters:
pcommand Command info (p1=filename)
Returns:
1 on success, -1 on any error

int ow_game::ow_commandline_savegame ( parsed_command *  pcommand  )  [private]

Save a game the current game into the file specified as second parameter

Parameters:
pcommand Command info (p2=filename)
Returns:
1 on success, -1 on any error

int ow_game::ow_commandline_setupboard ( parsed_command *  pcommand  )  [private]

Goes into the 'setupboard' mode and 'setup menu' screen. Sets the application to the OWGAME_STATUS_PLAYING status.

Parameters:
pcommand Command info and parameters (none) for the 'setup' command.
Returns:
-1 if game no created and cannot go to setup. 1 if ok.

int ow_game::ow_commandline_setupboard_confirm ( parsed_command *  pcommand  )  [private]

Checks that the correct number of seeds are in the board and goes to the mainmenu.

Parameters:
pcommand Command info and parameters (none) for the 'setupboard_confirm' command.
Returns:
-1 if cannot confirm setup. 0 if ok.

int ow_game::ow_commandline_setupboard_cancel ( parsed_command *  pcommand  )  [private]

Cancels the current setup, returning the board to the previous status.

Parameters:
pcommand Command info and parameters (none) for the 'setupboard_cancel' command.
Returns:
-1 if cannot cancel. 0 if ok.

int ow_game::ow_commandline_endgame ( parsed_command *  pcommand  )  [private]

Ends the game and deletes the associated resources (board,players,etc) Sets the application status to 'no game created' status.

Parameters:
pcommand Command info and parameters for the 'endgame' command.

void ow_game::ow_commandline_version ( parsed_command *  pcommand  )  [private]

Shows the app version info

Parameters:
pcommand Command info and parameters (none) for the 'version' command.

int ow_game::ow_commandline_quit ( parsed_command *  pcommand  )  [private]

Command line wrapper to the 'exitomweso' function.

Parameters:
pcommand Command info and parameters (none) for the 'quit' command.

void ow_game::ow_commandline_help ( parsed_command *  pcommand  )  [private]

Shows the help info for the command specified in pcommand parameter.

Parameters:
pcommand Command info and parameters for the specified command.

int ow_game::ow_commandline_play ( parsed_command *  pcommand  )  [private]

Goes into the 'playgame' mode and 'play menu' screen. Sets the application to the OWGAME_STATUS_PLAYING status.

Parameters:
pcommand Command info and parameters (none) for the 'play' command.
Returns:
-1 if game no created and cannot go to play. 1 if ok.

int ow_game::ow_commandline_batch ( parsed_command *  pcommand  )  [private]

Goes into the 'show/edit batch games' mode/menu screen. Let's create a batch of games to be run

Parameters:
pcommand Command info and parameters (none) for the 'batch' command.
Returns:
-1 if error. 1 if ok.

int ow_game::ow_commandline_setbatch ( parsed_command *  pcommand  )  [private]

Sets to run various games with the current configuration.

Parameters:
pcommand Command info and parameters (param1=number of games) for the 'batch' command.
Returns:
-1 if error. 1 if ok.

void ow_game::ow_commandline_showtxtboard ( parsed_command *  pcommand  )  [private]

Draws the board and game items in TXT format.

Parameters:
pcommand Command info and parameters (none) for the 'board' command.

int ow_game::ow_commandline_setvalue ( parsed_command *  pcommand  )  [private]

Sets the value of one of the configuration variables. Each variable can only be SET from the menu screen where it has scope.

Parameters:
pcommand Command info and parameters (param1=VARNAME,param2=VARVALUE) for the specified command.
Returns:
-1 if fails setting, 1 if sucessfull.

int ow_game::ow_commandline_setnextturn ( string  variablename,
string  plyID 
) [private]

Command line command wrapper for the setnewturn() & setfirstturn() methods.

Parameters:
variablename (FIRSTTURN/NEXTTURN)
plyID Player StringIDs (P1,P2)
Returns:
1 on success, -1 of failure.

int ow_game::ow_commandline_setnumcols ( string  numcols  )  [private]

Sets the number of columns in (this->config.numcols) the board.

Parameters:
numcols Number of columns
Returns:
1 on success, -1 on fail

int ow_game::ow_commandline_setplayer_aimode ( string  player_ai,
string  aimode 
) [private]

Sets the player AImode

Parameters:
player_ai String selecting the player (P1AI,P2AI)
aimode String selecting the aimode (HUMAN,SIMPLE,NEGAMAX,ALPHABETA,SCOUT)
Returns:
1 on success, -1 on fail

int ow_game::ow_commandline_setplayer_aidepth ( string  player_ai,
string  aidepth 
) [private]

Sets the player AImode algoritm DEPTH

Parameters:
player_ai String selecting the player (P1DEPTH,P2DEPTH)
aidepth String selecting the aidepth (1,2,3)
Returns:
1 on success, -1 on fail

int ow_game::ow_commandline_setplayer_aieval ( string  player_ai,
string  aieval 
) [private]

Sets the player AI evaluation function

Parameters:
player_ai String selecting the player (P1EVAL,P2EVAL)
aieval String selecting the aieval function (HUMAN,RANDOM,MATERIAL,DISPERSION,MOBILITY,REACH) Or combined aieval functions (COMBINED)
Returns:
1 on success, -1 on fail

int ow_game::ow_commandline_setgfxboard_status ( string  gfxstatus  )  [private]

Sets if the game is created and begins with the gfxboard on/off

Parameters:
gfxstatus Status of the gfxboard (ON/OFF)
Returns:
1 on success, -1 on fail

int ow_game::ow_commandline_creategame ( parsed_command *  pcommand  )  [private]

Creates a new game (board,players,etc) based on the this->config defined in the 'newgame' menu.

Parameters:
pcommand Command info and parameters (none) for the 'creategame' command.

void ow_game::ow_commandline_setcommand_help ( parsed_command *  pcommand  )  [private]

Shows help screen for the SET command

Parameters:
pcommand Command info and parameters (SET parameters) for the 'set' command.

int ow_game::ow_commandline_move ( parsed_command *  pcommand  )  [private]

Sends a 'move/sow' order to the board, so it executes the movement order. It will check if the movement is allowed, and if no other move is being executed.

Parameters:
pcommand Command info and parameters (pcommand.param1=cellname) for the 'move' command.
Returns:
0 on sucess, -1 if no movement can be performed.

int ow_game::ow_commandline_rcapture ( parsed_command *  pcommand  )  [private]

Sends a 'reverse capture' order to the board, so it executes reverse movement and capture. It will check if the reverse capture is allowed, and if no other move is being executed.

Parameters:
pcommand Command info and parameters (pcommand.param1=cellname) for the 'rcapture' command.
Returns:
0 on sucess, -1 if no movement can be performed.

int ow_game::ow_commandline_manageai ( parsed_command *  pcommand  )  [private]

Goes into the 'manage artificial intelligence' mode and 'manageai menu' screen.

Parameters:
pcommand Command info and parameters (none) for the 'manageai' command.

int ow_game::ow_commandline_mainmenu ( parsed_command *  pcommand  )  [private]

Goes into the 'mainmenu' screen allowing to load/save and create new games.

Parameters:
pcommand Command info and parameters (none) for the 'mainmenu' command.

cellXY ow_game::ow_commandline_translate_name2coord ( string  cellname  )  [private]

Translates the cell names (A1,A2,..,a1,a2) to the cell positions in the board cells array.

Parameters:
cellname Name of the cell, usually entered by the player.
Returns:
cellXY info (x,y,boardside) of the cell represented by 'cellname'.

void ow_game::createnewgame_useconfig (  )  [private]

Creates a new game (board,players,firstturn,etc) based on the this->config values.

void ow_game::set_default_gameconfig ( game_configuration *  config  )  [private]

Sets the default values for game config (player names, numcols, etc)

Parameters:
config If NULL the default values are applied to this->config, if param not null, given variable is filled with default values

int ow_game::loadgame ( string  filename  )  [private]

Creates a new game and sets it up with the info loaded from the specified file.

Parameters:
filename Name of the savegame file. See file format at app user guide.
Returns:
0 on success, -1 on fileformat error, -2 any other error

int ow_game::savegame ( string  filename  )  [private]

Saves the current game into the specified file, overwriting the file if exists

Parameters:
filename Name of the savegame file. See file format at app user guide.
Returns:
0 on success, -1 on error saving savegame.

int ow_game::setupboard_fromarray ( int  arraydata[BRD_MAX_COLS_PER_PLAYER][(BRD_MAX_ROWS_PER_PLAYER *BRD_NUM_SIDES)]  )  [private]

Sets up the number of seeds in each cell of the board from the info in the array provided. Usually the array is generated by loadgame() function.

Parameters:
arraydata Array containing the number of seeds in each cell. Note: The array data arraydata[column][row] is stored in the same order as the board is displayed by draw_txt(), not in the order stablished by the cell names.
Returns:
0 on success, -1 on error setting up the board.

void ow_game::setnewturn ( ow_player player  )  [private]

Set the next turn for the specified player

Parameters:
player Player who you want to set the next turn to.

void ow_game::setfirstturn ( ow_player player  )  [private]

Set turn to the specified player, used to setup the first turn of the game.

Parameters:
player Specified player.

int ow_game::load_gfxdata (  )  [private]

Load the graphical items data files for the game.

int ow_game::gfxboard_showhidde (  )  [private]

Shows the graphical board (or hiddes it if it is already shown).

void ow_game::draw (  )  [private]

Draws the graphical items of the game. Usually called from draw_gfx()

void ow_game::endgame (  )  [private]

Ends the current game, basically deletes board, players and other resources.

void ow_game::exitomweso (  )  [private]

Sets the application to the 'Stopped' so the application ends and exits. 'Stopped' is one of the game posible status.(OWGAME_STATUS_STOPPED,OWGAME_STATUS_RUNNING,OWGAME_STATUS_CREATED,OWGAME_STATUS_PLAYING)

int ow_game::ow_commandline_undolastmove ( parsed_command *  pcommand  )  [private]

UnDo the last move executed

Parameters:
pcommand Command info and parameters (none) for the 'undom' command.
Returns:
-1 on fail, 1 on success

int ow_game::ow_commandline_redolastmove ( parsed_command *  pcommand  )  [private]

ReDo the last move 'undone' by the 'undom' command.

Parameters:
pcommand Command info and parameters (none) for the 'redo' command.
Returns:
-1 on fail, 1 on success

int ow_game::ow_commandline_undolastturn ( parsed_command *  pcommand  )  [private]

UnDo the last turn (usually 2 moves) executed

Parameters:
pcommand Command info and parameters (none) for the 'undo' command.
Returns:
-1 on fail, 1 on success

void ow_game::ow_setcommandlinehandlers ( rl_vcpfunc_t *  commhandler,
rl_vcpfunc_t *  commhandler_null,
rl_completion_func_t *  commhandler_completion,
rl_compentry_func_t *  commhandler_command,
rl_compignore_func_t *  commhandler_savegames_filter 
)

Sets the commandline handlers and creates the command line prompt, so it is ready to receive the first order.

Parameters:
commhandler Function that will handle the orders entered by the user throught the command line..
commhandler_null Function that does nothing while the game is busy.
commhandler_completion Function that manages the readline completion
commhandler_command Function that manages readline 'appcommands' completion
commhandler_savegames_filter function that manage savegame filenames completion.

char ** ow_game::commandline_completion ( const char *  text,
int  start,
int  end 
)

Manages the commandline (readline) completion. It manages if it is a 'appcommand' completion, or a savegame filename completion, calling commandline_command_generator() or commandline_savegames_filter() accordingly. For parameters definition, refer to : readline, rl_completion_func_t.

char * ow_game::commandline_command_generator ( const char *  text,
int  state 
)

Supports the 'readline' completion method generating the completion for 'appcommands'. For parameters definition, refer to: readline, rl_compentry_func_t.

int ow_game::commandline_savegames_filter ( char **  matches  ) 

Filters the 'readline' standard filename completion, removing all but the savegame files. For parameters definition refer to: readline, rl_compignore_func_t.

void ow_game::commandline_read (  ) 

Reads each keystroke of the command line and generates a new 'command' string when and 'endl/intro/enter' is received. The commandline handler function is called by an event passing the new 'command' string generated.

void ow_game::commandline_parse_execute ( char *  command  ) 

Parses every command line received searching for known commands. and executes the found commands.

Parameters:
command Command line to parse.

string ow_game::ow_commandline_translate_coord2name ( int  boardside,
int  cellx,
int  celly 
)

Translates the cell position in the board cells array into the cellname (A1,A2,..,a1,a2..) used by the players to name the cells.

Parameters:
boardside Side of the board (BRD_SIDE_NORTH, BRD_SIDE_SOUTH).
cellx Xpos of the specified cell in the board bcells array.
celly Ypos of the specified cell in the board bcells array.
Returns:
'Name' string of the cell specified by (boardside,cellx,celly)

int ow_game::ow_commandline_setupboard_put ( parsed_command *  pcommand  ) 

Setups board. Adds seeds to the specified cell of the current game board. It will check if max number of seeds in board is reached before putting.

Parameters:
pcommand Command put and parameters (param1=cellname, param2=numseeds) for the 'put' command.
Returns:
0 on sucess, -1 if no put can be performed.

int ow_game::ow_commandline_setupboard_take ( parsed_command *  pcommand  ) 

Setups board. Take seeds from the specified cell of the current game board.

Parameters:
pcommand Command put and parameters (param1=cellname, param2=numseeds) for the 'take' command.
Returns:
0 on sucess, -1 if no put can be performed.

void ow_game::ow_commandline_showgameconfig ( parsed_command *  pcommand  ) 

Shows this->config info, this info is usually used to create new games.

Parameters:
pcommand Command info and parameters (none) for the specified command.

int ow_game::selplayer_getboardside (  ) 

Gets the board side where the selected player plays.

Returns:
Board side of the selected player (BRD_SIDE_NORTH,BRD_SIDE_SOUTH).

int ow_game::selplayer_makemovement ( int  boardside,
int  cellx,
int  celly 
)

Orders a new sow movement for the board to execute.

Parameters:
boardside Side of the board (BRD_SIDE_NORTH, BRD_SIDE_SOUTH).
cellx Xpos of the specified cell in the board bcells array.
celly Ypos of the specified cell in the board bcells array.
Returns:
0 on success, -1 on any error.

int ow_game::selplayer_rcapture ( int  boardside,
int  cellx,
int  celly 
)

Orders a new reverse movement ending with capture for the board to execute.

Parameters:
boardside Side of the board (BRD_SIDE_NORTH, BRD_SIDE_SOUTH).
cellx Xpos of the specified cell in the board bcells array.
celly Ypos of the specified cell in the board bcells array.
Returns:
0 on success, -1 on any error.

int ow_game::selplayer_getaimode (  ) 

Gets the selected player AI (Artificial Intelligence) mode.

Returns:
AI mode used by the selected player.(AI_HUMAN,AI_COMPUTER,etc)

int ow_game::selplayer_aimove_found (  ) 

Checks if current selected player finished searching for best AI move

Returns:
-1 if no move available, 0 if still looking for, 1 if best AI move found

ow_move ow_game::selplayer_aimove (  ) 

Looks for the best AI move for the current selected player. Execute it repeatly while not selplayer_aimove_found()

Returns:
when selplayer_aimove_found() this returns the cell coords to start the best AI move.

int ow_game::selplayer_endofturn (  ) 

Checks if the selected player has ended his turn and is sleeping waiting for his next turn.

int ow_game::board_endofturn (  ) 

Checks if the board has finished executing the orders inserted by the player. Some orders take various board_update_status() loops so you must wait before next order can be issued.

void ow_game::board_update_status (  ) 

Updates the board status as it executes step by step the orders received. Some orders take various board_update_status() loops as example 'sowing' takes a loop for every seed sowm in the movement.

string ow_game::board_translate_coord2name ( int  boardside,
int  cellx,
int  celly 
)

Gets the name of the board cell corresponding to the given cell coords.

Parameters:
boardside Side of the board (BRD_SIDE_NORTH, BRD_SIDE_SOUTH).
cellx Xpos of the specified cell in the bcells array.
celly Ypos of the specified cell in the bcells array.
Returns:
The name of the cell

void ow_game::changeturn (  ) 

Ends the turn of the current player, and sets the turn to the next player.

int ow_game::gamerunning (  ) 

Returns true if the game is running 'Running' is one of the game posible status.(OWGAME_STATUS_STOPPED,OWGAME_STATUS_RUNNING,OWGAME_STATUS_CREATED,OWGAME_STATUS_PLAYING)

Returns:
1 if running, 0 if not running.

int ow_game::gamecreated (  ) 

Returns true if the game is created 'Created' is one of the game posible status.(OWGAME_STATUS_STOPPED,OWGAME_STATUS_RUNNING,OWGAME_STATUS_CREATED,OWGAME_STATUS_PLAYING)

Returns:
1 if created, 0 if not created.

int ow_game::gameplaying (  ) 

Returns true if the game is being played. 'Playing' is one of the game posible status.(OWGAME_STATUS_STOPPED,OWGAME_STATUS_RUNNING,OWGAME_STATUS_CREATED,OWGAME_STATUS_PLAYING)

Returns:
1 if being played, 0 if not being played.

int ow_game::gamesettingup (  ) 

Checks if we are in the setup board mode.

Returns:
1 if setting up, 0 if not.

void ow_game::rungame (  ) 

Sets the application to the 'Running' status so it starts running. 'Running' is one of the game posible status.(OWGAME_STATUS_STOPPED,OWGAME_STATUS_RUNNING,OWGAME_STATUS_CREATED,OWGAME_STATUS_PLAYING)

int ow_game::checkgamewon (  ) 

Checks if any of the players won the game. (status=OWGAME_STATUS_WON)

void ow_game::show_version (  ) 

Prints out the version info of the app.

void ow_game::draw_gfx (  ) 

Draws in the screen surface a frame for the graphical board, and game items.

int ow_game::MouseLeftButtonClicked ( int *  mouse_x,
int *  mouse_y 
)

Check if Mouse button has been clicked and if so gets the mouse_x,mouse_y values.

Parameters:
mouse_x Xpos of the mouse pointer when the button was clicked.
mouse_y Ypos of the mouse pointer when the button was clicked.
Returns:
1 if mouse button clicked, 0 if mouse button not clicked.

int ow_game::MouseRightButtonClicked ( int *  mouse_x,
int *  mouse_y 
)

Check if Right Mouse button has been clicked and if so gets the mouse_x,mouse_y values.

Parameters:
mouse_x Xpos of the mouse pointer when the button was clicked.
mouse_y Ypos of the mouse pointer when the button was clicked.
Returns:
1 if right mouse button clicked, 0 if mouse button not clicked.

ow_move ow_game::seleccionarcelda_bycoord ( int  coordx,
int  coordy 
)

Used to get the board cell 'under' the mouse cursor when the mouse button was clicked.

Parameters:
coordx Xpos of the mouse pointer when the button was clicked.
coordy Ypos of the mouse pointer when the button was clicked.
Returns:
info of the cell under the mouse cursor (x,y,boardside).


The documentation for this class was generated from the following files:
Generated on Sun Jun 22 13:45:48 2008 for Omweso by  doxygen 1.5.3