Sokoban
|
Class representing game window. More...
#include <SokobanApp.h>
Public Member Functions | |
void | setup () override |
void | draw () override |
void | keyDown (ci::app::KeyEvent event) override |
SokobanApp () | |
Private Member Functions | |
~SokobanApp () | |
This is the group of the functions for buttons. | |
void | button_load () |
void | button_restart () |
void | button_solve () |
void | button_play_solution () |
void | button_login () |
void | button_previous_map () |
void | button_next_map () |
Tool functions. For settings app parameters, drawing map, etc. | |
void | set_new_map_params () |
void | set_no_map_params () |
void | set_high_score_strings () |
void | draw_map () |
void | initialize_users_progress () |
void | initialize_highscore () |
void | initialize_textures () |
void | create_menu () |
Private Attributes | |
Variables defining current game status such as current loaded map, current user, sizes, etc. | |
bool | keys_disabled |
bool | new_map_set |
bool | complete |
bool | solved |
int | s_x |
int | s_y |
std::string | map_pack_id |
int | current_map_index |
std::string | m_user |
User * | current_user |
Strings which are drawed in app including highscores, status line, map name. | |
std::string | status_line_word |
std::string | map_best_word |
std::string | user_best_word |
std::string | map_pack_name_word |
std::string | user_name_word |
std::string | game_mode_word |
Variables representing an engine of the game including list of maps, highscore database, timer, list of users | |
std::vector< std::unique_ptr< Map > > | list_of_maps |
ci::params::InterfaceGlRef | mParams |
ci::gl::Texture2dRef | textures [SinglePlayerMap::NUMBER_OF_FIELDS] |
MyTimer | timer |
std::vector< User > | available_users |
HighScore | highScore |
Static Private Attributes | |
Constans used in application. | |
static const float | FONT_SIZE |
static const float | FIELD_SIZE_X |
static const float | FIELD_SIZE_Y |
static const float | MENU_X |
static const float | MENU_Y |
static const float | MENU_OFFSET |
static const float | TEXT_BOX_HEIGHT |
static const float | STATUS_WORD_DEFAULT_LENGTH |
static const char | MAP_SEPARATOR |
static const char | USERS_SETINGS_SEPARATOR |
static const char | MAP_ID_SEPARATOR |
static const int | MAX_MAP_PACK_ID_LENGTH |
static const char | USER_SOURCE_FILE [] |
static const char | HIGHSCORE_SOURCE_FILE [] |
static const char | MAP_HIHGSCORE_LABEL [] |
static const char | USER_HIGHSCORE_LABEL [] |
static const char | MAP_PACK_LOADED_LABEL [] |
static const char | NUMBER_OF_MAP_LOADED_LABEL [] |
static const std::vector< char > | FORBIDDEN_MAP_ID_CHARS |
static const std::vector< char > | FORBIDDEN_USER_NAME_CHARS |
static const std::vector< std::string > | extensions |
Class representing game window.
It is responsible to creating game environment and to interaction with keys.
SokobanApp::SokobanApp | ( | ) |
|
private |
Destructor. Writes highscore and the data of users to files.
|
private |
Function for loading map pack (button load in menu).
|
private |
Funcion for the logging in the user (button login).
|
private |
Function for the loading the next map from the map pack (button next map).
|
private |
Funcion for the button which do next step in the solution of map.
|
private |
Function for the loading the previous map from the map pack (button previous map).
|
private |
Function for restarting current map (button restart in menu).
|
private |
Function for the button solve (solving current map)
|
private |
Creates menu (adds buttons, etc.).
|
override |
|
private |
Drawa the current loaded map (game grid).
|
private |
Loads highscore database from the data file.
|
private |
Loads images representing game emelemts (ground, wall, etc.) as textures.
|
private |
Loads users progress from the data file.
|
override |
|
private |
Set highscore for the current loaded map.
|
private |
Sets parametrs (strings, size, etc.) for the current loaded map.
|
private |
Sets parametrs (strings, size, etc.) for the situation when no map is loaded.
|
override |
|
private |
Vector of users which have ever played the game.
|
private |
Bool variable which determines if the map (puzzle) is solved by user.
|
private |
Integer variable representing which map from the list of maps is played.
|
private |
Pointer to user which is logged in.
|
staticprivate |
Vector of prefered extensions for map pack files.
|
staticprivate |
Width (in pixels) of the cell in game grid which represents a game element (ground, wall, barrel etc.)
|
staticprivate |
Height (in pixels) of the cell in game grid which represents a game element (ground, wall, barrel etc.)
|
staticprivate |
Size of font for drawing game information.
|
staticprivate |
Vectors of the forbidden symbols in map id.
|
staticprivate |
Vectors of the forbidden symbols in user name.
|
private |
String which contains "single player" or "multi player" according to the game mode.
|
private |
Highscore database.
|
staticprivate |
Name of the source file for highscore data.
|
private |
Bool variable which determines if keys are disabled.
|
private |
|
private |
String representing a content of text box for user logging in
|
private |
String which contains best highscore for the current map.
|
staticprivate |
Label which is drawed before map highscore.
|
staticprivate |
Character which separates name of map pack and the number of map which is played. This two strings are made map id for highscore.
|
private |
|
staticprivate |
Label which is drawed before the current map pack name.
|
private |
String which contains name of the current loaded map pack.
|
staticprivate |
Character which must be at the end of map file.
|
staticprivate |
Maximal length of the map pack id.
|
staticprivate |
Distance between the menu and the game grid and between the menu and the border of window.
|
staticprivate |
Width (in pixels) of the menu.
|
staticprivate |
Height (in pixels) of the menu.
|
private |
Feature of Cinder library which represents a menu in this app.
|
private |
Bool variable which determines if the new map was loaded.
|
staticprivate |
Label which is drawed before the current map index within map pack.
|
private |
Width of current map which is drawed (number of cells)
|
private |
Width of current map which is drawed (number of cells)
|
private |
Bool variable which determines if solver have solved the map.
|
private |
String which contains the word describing the current game status.
|
staticprivate |
Default length of the word which describes a game status.
|
staticprivate |
Height of all words which are drawed.
|
private |
Array of textures which represents game elemets.
|
private |
Timer which measures the length of finding solution
|
private |
String which contains the best highscore for the current user.
|
staticprivate |
Label which is drawed before user highscore.
|
private |
not used
|
staticprivate |
Name of the source file for user data (proress).
|
staticprivate |
Character which separates information for users in data file.