#include <ow_game.h>
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_player * | p1 |
ow_player * | p2 |
ow_board * | owtab |
ow_player * | selected_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 |
ow_game::ow_game | ( | ) |
Creates a new 'ow_game' object, with the default values.
ow_game::~ow_game | ( | ) |
Deletes an existing 'ow_game' object, including its related resources.
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
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
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.
pcommand | Command showlog and parameters (none) for the 'logm' command. |
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.
pcommand | Command parameters (param1=ON|OFF, param2=logfilename). |
int ow_game::undolastmove | ( | int | nummoves | ) | [private] |
UnDo the last (nummoves) movement(s) executed
nummoves | Number of moves to UnDo. |
int ow_game::redolastundo | ( | int | nummoves | ) | [private] |
ReDo the last move 'undone' by the 'undom' command.
nummoves | Number of moves to ReDo, if available. |
void ow_game::commandline_parse_command | ( | char * | command, | |
parsed_command * | pcommand | |||
) | [private] |
Parses the command line received, generating a parsed command to execute.
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.
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.
pcommand | Command info and parameters (none) for the 'newgame' command. |
int ow_game::ow_commandline_loadgame | ( | parsed_command * | pcommand | ) | [private] |
Load a game into the current game, from the file specified as second parameter
pcommand | Command info (p1=filename) |
int ow_game::ow_commandline_savegame | ( | parsed_command * | pcommand | ) | [private] |
Save a game the current game into the file specified as second parameter
pcommand | Command info (p2=filename) |
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.
pcommand | Command info and parameters (none) for the 'setup' command. |
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.
pcommand | Command info and parameters (none) for the 'setupboard_confirm' command. |
int ow_game::ow_commandline_setupboard_cancel | ( | parsed_command * | pcommand | ) | [private] |
Cancels the current setup, returning the board to the previous status.
pcommand | Command info and parameters (none) for the 'setupboard_cancel' command. |
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.
pcommand | Command info and parameters for the 'endgame' command. |
void ow_game::ow_commandline_version | ( | parsed_command * | pcommand | ) | [private] |
Shows the app version info
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.
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.
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.
pcommand | Command info and parameters (none) for the 'play' command. |
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
pcommand | Command info and parameters (none) for the 'batch' command. |
int ow_game::ow_commandline_setbatch | ( | parsed_command * | pcommand | ) | [private] |
Sets to run various games with the current configuration.
pcommand | Command info and parameters (param1=number of games) for the 'batch' command. |
void ow_game::ow_commandline_showtxtboard | ( | parsed_command * | pcommand | ) | [private] |
Draws the board and game items in TXT format.
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.
pcommand | Command info and parameters (param1=VARNAME,param2=VARVALUE) for the specified command. |
int ow_game::ow_commandline_setnextturn | ( | string | variablename, | |
string | plyID | |||
) | [private] |
Command line command wrapper for the setnewturn() & setfirstturn() methods.
variablename | (FIRSTTURN/NEXTTURN) | |
plyID | Player StringIDs (P1,P2) |
int ow_game::ow_commandline_setnumcols | ( | string | numcols | ) | [private] |
Sets the number of columns in (this->config.numcols) the board.
numcols | Number of columns |
int ow_game::ow_commandline_setplayer_aimode | ( | string | player_ai, | |
string | aimode | |||
) | [private] |
Sets the player AImode
player_ai | String selecting the player (P1AI,P2AI) | |
aimode | String selecting the aimode (HUMAN,SIMPLE,NEGAMAX,ALPHABETA,SCOUT) |
int ow_game::ow_commandline_setplayer_aidepth | ( | string | player_ai, | |
string | aidepth | |||
) | [private] |
Sets the player AImode algoritm DEPTH
player_ai | String selecting the player (P1DEPTH,P2DEPTH) | |
aidepth | String selecting the aidepth (1,2,3) |
int ow_game::ow_commandline_setplayer_aieval | ( | string | player_ai, | |
string | aieval | |||
) | [private] |
Sets the player AI evaluation function
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) |
int ow_game::ow_commandline_setgfxboard_status | ( | string | gfxstatus | ) | [private] |
Sets if the game is created and begins with the gfxboard on/off
gfxstatus | Status of the gfxboard (ON/OFF) |
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.
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
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.
pcommand | Command info and parameters (pcommand.param1=cellname) for the 'move' command. |
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.
pcommand | Command info and parameters (pcommand.param1=cellname) for the 'rcapture' command. |
int ow_game::ow_commandline_manageai | ( | parsed_command * | pcommand | ) | [private] |
Goes into the 'manage artificial intelligence' mode and 'manageai menu' screen.
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.
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.
cellname | Name of the cell, usually entered by the player. |
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)
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.
filename | Name of the savegame file. See file format at app user guide. |
int ow_game::savegame | ( | string | filename | ) | [private] |
Saves the current game into the specified file, overwriting the file if exists
filename | Name of the savegame file. See file format at app user guide. |
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.
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. |
void ow_game::setnewturn | ( | ow_player * | player | ) | [private] |
Set the next turn for the specified player
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.
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
pcommand | Command info and parameters (none) for the 'undom' command. |
int ow_game::ow_commandline_redolastmove | ( | parsed_command * | pcommand | ) | [private] |
ReDo the last move 'undone' by the 'undom' command.
pcommand | Command info and parameters (none) for the 'redo' command. |
int ow_game::ow_commandline_undolastturn | ( | parsed_command * | pcommand | ) | [private] |
UnDo the last turn (usually 2 moves) executed
pcommand | Command info and parameters (none) for the 'undo' command. |
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.
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.
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.
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_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.
pcommand | Command put and parameters (param1=cellname, param2=numseeds) for the 'put' command. |
int ow_game::ow_commandline_setupboard_take | ( | parsed_command * | pcommand | ) |
Setups board. Take seeds from the specified cell of the current game board.
pcommand | Command put and parameters (param1=cellname, param2=numseeds) for the 'take' command. |
void ow_game::ow_commandline_showgameconfig | ( | parsed_command * | pcommand | ) |
Shows this->config info, this info is usually used to create new games.
pcommand | Command info and parameters (none) for the specified command. |
int ow_game::selplayer_getboardside | ( | ) |
Gets the board side where the selected player plays.
int ow_game::selplayer_makemovement | ( | int | boardside, | |
int | cellx, | |||
int | celly | |||
) |
Orders a new sow movement for the board to execute.
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::selplayer_rcapture | ( | int | boardside, | |
int | cellx, | |||
int | celly | |||
) |
Orders a new reverse movement ending with capture for the board to execute.
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::selplayer_getaimode | ( | ) |
Gets the selected player AI (Artificial Intelligence) mode.
int ow_game::selplayer_aimove_found | ( | ) |
Checks if current selected player finished searching for best AI move
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()
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.
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. |
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)
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)
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)
int ow_game::gamesettingup | ( | ) |
Checks if we are in the setup board mode.
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.
mouse_x | Xpos of the mouse pointer when the button was clicked. | |
mouse_y | Ypos of the mouse pointer when the button was 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.
mouse_x | Xpos of the mouse pointer when the button was clicked. | |
mouse_y | Ypos of the mouse pointer when the button was 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.
coordx | Xpos of the mouse pointer when the button was clicked. | |
coordy | Ypos of the mouse pointer when the button was clicked. |