#include <game.h>

Public Member Functions | |
| Game (const char *id) | |
| virtual | ~Game () |
| bool | Open () |
| bool | Run () |
| void | Close () |
| bool | IsRun () const |
| void | Quit () |
| void | SaveScreenshot () |
| void | SetTitle (const string &title) |
| const string & | GetTitle () const |
| Font * | GetSystemFont () const |
| OnScreenText * | GetOnScreenText () const |
| Selection * | GetSelection () const |
| bool | ActivateProfile (const string &id) |
| bool | ActivateGui (const string &id) |
| bool | ActivateLevel (const string &id) |
| Profile * | GetActiveProfile () const |
| Gui * | GetActiveGui () const |
| Level * | GetActiveLevel () const |
| Map * | GetActiveMap () const |
| Player * | GetActivePlayer () const |
| Profile * | GetProfile (const string &id) const |
| Gui * | GetGui (const string &id) const |
| Level * | GetLevel (const string &id) const |
| Map * | GetMap (const string &id) const |
| Scheme * | GetScheme (const string &id) const |
| Race * | GetRace (const string &id) const |
| bool | SetUnitSelRenderer (const string &class_name) |
| bool | SetBuildingSelRenderer (const string &class_name) |
| SelectionRenderer * | GetUnitSelRenderer () const |
| SelectionRenderer * | GetBuildingSelRenderer () const |
Protected Member Functions | |
| Preloaded * | NewPreloaded (const char *class_name, Root *root, const string &file_name) |
| bool | LoadProfiles () |
| bool | ActivateProfile (Profile *profile) |
| void | CreateDefaultProfile () |
| bool | ActivateLastProfile () |
| bool | LoadGuis () |
| bool | ActivateGui (Gui *gui) |
| bool | LoadLevels () |
| bool | ActivateLevel (Level *level) |
| bool | LoadMaps () |
| bool | LoadSchemes () |
| bool | LoadRaces () |
| SelectionRenderer * | NewSelRenderer (const string &class_name) |
Static Protected Member Functions | |
| static void | OnSize (ushort_t width, ushort_t height, bool fullscreen) |
| static bool | OnKey (KeyCode code, KeyState state) |
| static bool | OnAction (const string &action, int position, void *data) |
| static void | OnLog (LogServer::LogLevel level, const string &file_name, int line, const string &text) |
Protected Attributes | |
| string | title |
| Game title. | |
| bool | opened |
| Whether game is opened. | |
| bool | run |
| Whether game is running. | |
| Ref< FileServer > | file_server |
| Pointer to file server. | |
| Ref< SerializeServer > | serialize_server |
| Pointer to serialize server. | |
| Ref< GfxServer > | gfx_server |
| Pointer to gfx server. | |
| Ref< SceneServer > | scene_server |
| Pointer to scene server. | |
| Ref< TimeServer > | time_server |
| Pointer to time server. | |
| Ref< MessageServer > | message_server |
| Pointer to message server. | |
| Ref< InputServer > | input_server |
| Pointer to input server. | |
| Ref< PathServer > | path_server |
| Pointer to path server. | |
| Ref< AudioServer > | audio_server |
| Pointer to audio server. | |
| Ref< RemoteServer > | remote_server |
| Pointer to remote server. | |
| Ref< Root > | variables |
| Root node of all system variables. | |
| Ref< Root > | profiles |
| Root node of all profiles. | |
| Ref< Root > | guis |
| Root node of all GUIs. | |
| Ref< Root > | maps |
| Root node of all maps. | |
| Ref< Root > | schemes |
| Root node of all schemes. | |
| Ref< Root > | races |
| Root node of all races. | |
| Ref< Root > | levels |
| Root node of all levels. | |
| Ref< Root > | sel_renderers |
| Root node of all selection renderers. In fact, there will be only two renderers: for units and for buildings. | |
| Ref< Font > | system_font |
| System font. | |
| Ref< Profile > | active_profile |
| Active profile. | |
| Ref< Gui > | active_gui |
| Active GUI. | |
| Ref< Level > | active_level |
| Active level. | |
| Ref< Map > | active_map |
| Map of active level. | |
| Ref< Player > | active_player |
| Active player. | |
| Ref< SelectionRenderer > | unit_sel_renderer |
| Active selection renderer for units. | |
| Ref< SelectionRenderer > | building_sel_renderer |
| Active selection renderer for buildings;. | |
| MouseInfo | mouse_info |
| Ref< OnScreenText > | ost |
| Pointer to on-screen-text object. | |
| Ref< Selection > | selection |
| Pointer to selection object. | |
Private Member Functions | |
| void | Update () |
| void | Render () |
| void | UpdateOstDimensions () |
| Game::Game | ( | const char * | id | ) |
File server is required to be created before.
| Game::~Game | ( | ) | [virtual] |
Empty.
| bool Game::Open | ( | ) |
Opens game. Methods loads game settings, runs setup script and opens application window. Setup script is not mandatory, it can be presented on scripts:setup_game.lua path.
True if successful. | bool Game::Run | ( | ) |
Runs game. Method starts time server and provides main game loop. In this loop whole game is drawn and all servers are triggered.
True if successful. | void Game::Close | ( | ) |
Closes game. Saves active profile and closes audio device.
| bool Game::IsRun | ( | ) | const [inline] |
Returns running state.
| void Game::Quit | ( | ) |
Closes the game.
| void Game::SaveScreenshot | ( | ) |
| void Game::SetTitle | ( | const string & | title | ) |
| const string & Game::GetTitle | ( | ) | const [inline] |
| Font * Game::GetSystemFont | ( | ) | const [inline] |
| OnScreenText * Game::GetOnScreenText | ( | ) | const [inline] |
| Selection * Game::GetSelection | ( | ) | const [inline] |
| bool Game::ActivateProfile | ( | const string & | id | ) |
| bool Game::ActivateGui | ( | const string & | id | ) |
Activates given GUI.
| id | GUI identifier. |
True if successful. | bool Game::ActivateLevel | ( | const string & | id | ) |
| Profile * Game::GetActiveProfile | ( | ) | const [inline] |
| Gui * Game::GetActiveGui | ( | ) | const [inline] |
| Level * Game::GetActiveLevel | ( | ) | const [inline] |
| Map * Game::GetActiveMap | ( | ) | const [inline] |
| Player * Game::GetActivePlayer | ( | ) | const [inline] |
| Profile * Game::GetProfile | ( | const string & | id | ) | const [inline] |
| Gui * Game::GetGui | ( | const string & | id | ) | const [inline] |
| Level * Game::GetLevel | ( | const string & | id | ) | const [inline] |
| Map * Game::GetMap | ( | const string & | id | ) | const [inline] |
| Scheme * Game::GetScheme | ( | const string & | id | ) | const [inline] |
| Race * Game::GetRace | ( | const string & | id | ) | const [inline] |
| bool Game::SetUnitSelRenderer | ( | const string & | class_name | ) |
| bool Game::SetBuildingSelRenderer | ( | const string & | class_name | ) |
| SelectionRenderer * Game::GetUnitSelRenderer | ( | ) | const [inline] |
| SelectionRenderer * Game::GetBuildingSelRenderer | ( | ) | const [inline] |
| bool Game::LoadProfiles | ( | ) | [protected] |
Creates all profiles from "profiles:" directory. If there is no profile or some error occures, the default one is created. Old profiles are released first. Last active profile is loaded and activated.
| bool Game::ActivateProfile | ( | Profile * | profile | ) | [protected] |
Activates given profile.
| profile | Pointer to profile. |
True if successful. | void Game::CreateDefaultProfile | ( | ) | [protected] |
| bool Game::ActivateLastProfile | ( | ) | [protected] |
Re-activates first profile with true active flag.
True if successful. | bool Game::LoadGuis | ( | ) | [protected] |
Creates all GUIs from "guis:" directory. Old GUIs are released first. No GUI is loaded.
| bool Game::ActivateGui | ( | Gui * | gui | ) | [protected] |
Activates given gui.
| gui | Pointer to GUI. |
True if successful.
| bool Game::LoadLevels | ( | ) | [protected] |
Creates all levels from "levels:" directory. Old levels are released first. No level is loaded.
| bool Game::ActivateLevel | ( | Level * | level | ) | [protected] |
Activates given level.
| level | Pointer to level. |
True if successful. | bool Game::LoadMaps | ( | ) | [protected] |
Creates all maps from "maps:" directory. Old maps are released first. No map is loaded.
| bool Game::LoadSchemes | ( | ) | [protected] |
Creates all schemes from "schemes:" directory. Old schemes are released first. No scheme is loaded.
| bool Game::LoadRaces | ( | ) | [protected] |
Creates all races from "races:" directory. Old races are released first. No race is loaded.
| SelectionRenderer * Game::NewSelRenderer | ( | const string & | class_name | ) | [protected] |
| bool Game::OnAction | ( | const string & | action, | |
| int | position, | |||
| void * | data | |||
| ) | [static, protected] |
| void Game::OnLog | ( | LogServer::LogLevel | level, | |
| const string & | file_name, | |||
| int | line, | |||
| const string & | text | |||
| ) | [static, protected] |
| void Game::Update | ( | ) | [inline, private] |
| void Game::Render | ( | ) | [inline, private] |
| void Game::UpdateOstDimensions | ( | ) | [inline, private] |
string Game::title [protected] |
Game title.
bool Game::opened [protected] |
Whether game is opened.
bool Game::run [protected] |
Whether game is running.
Ref<FileServer> Game::file_server [protected] |
Pointer to file server.
Ref<SerializeServer> Game::serialize_server [protected] |
Pointer to serialize server.
Ref<GfxServer> Game::gfx_server [protected] |
Pointer to gfx server.
Ref<SceneServer> Game::scene_server [protected] |
Pointer to scene server.
Ref<TimeServer> Game::time_server [protected] |
Pointer to time server.
Ref<MessageServer> Game::message_server [protected] |
Pointer to message server.
Ref<InputServer> Game::input_server [protected] |
Pointer to input server.
Ref<PathServer> Game::path_server [protected] |
Pointer to path server.
Ref<AudioServer> Game::audio_server [protected] |
Pointer to audio server.
Ref<RemoteServer> Game::remote_server [protected] |
Pointer to remote server.
Ref<Root> Game::variables [protected] |
Root node of all system variables.
Ref<Root> Game::profiles [protected] |
Root node of all profiles.
Ref<Root> Game::guis [protected] |
Root node of all GUIs.
Ref<Root> Game::maps [protected] |
Root node of all maps.
Ref<Root> Game::schemes [protected] |
Root node of all schemes.
Ref<Root> Game::races [protected] |
Root node of all races.
Ref<Root> Game::levels [protected] |
Root node of all levels.
Ref<Root> Game::sel_renderers [protected] |
Root node of all selection renderers. In fact, there will be only two renderers: for units and for buildings.
Ref<Font> Game::system_font [protected] |
System font.
Ref<Profile> Game::active_profile [protected] |
Active profile.
Ref<Gui> Game::active_gui [protected] |
Active GUI.
Ref<Level> Game::active_level [protected] |
Active level.
Ref<Map> Game::active_map [protected] |
Map of active level.
Ref<Player> Game::active_player [protected] |
Active player.
Ref<SelectionRenderer> Game::unit_sel_renderer [protected] |
Active selection renderer for units.
Ref<SelectionRenderer> Game::building_sel_renderer [protected] |
Active selection renderer for buildings;.
MouseInfo Game::mouse_info [protected] |
Ref<OnScreenText> Game::ost [protected] |
Pointer to on-screen-text object.
Ref<Selection> Game::selection [protected] |
Pointer to selection object.
1.5.3