home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / SMC_1.6_win32.exe / src / overworld / world_manager.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-01  |  2.7 KB  |  95 lines

  1. /***************************************************************************
  2.  * overworld.h  -  header for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2004 - 2008 Florian Richter
  5.  ***************************************************************************/
  6. /*
  7.    This program is free software; you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation; either version 3 of the License, or
  10.    (at your option) any later version.
  11.    
  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. #ifndef SMC_WORLD_MANAGER_H
  17. #define SMC_WORLD_MANAGER_H
  18.  
  19. #include "../core/globals.h"
  20. #include "../core/obj_manager.h"
  21. #include "../core/camera.h"
  22.  
  23. /* *** *** *** *** *** *** *** *** cOverworld_Manager *** *** *** *** *** *** *** *** *** */
  24.  
  25. class cOverworld;
  26.  
  27. class cOverworld_Manager : public CEGUI::XMLHandler, public cObject_Manager<cOverworld>
  28. {
  29. public:
  30.     cOverworld_Manager( void );
  31.     virtual ~cOverworld_Manager( void );
  32.  
  33.     /* Create a new world
  34.      * returns true if successful
  35.     */
  36.     bool New( string name );
  37.  
  38.     // Load all overworlds
  39.     void Load( void );
  40.     /* Load overworlds from given directory
  41.      * user_dir : if set overrides game worlds
  42.     */
  43.     void Load_Dir( string dir, bool user_dir = 0 );
  44.  
  45.     // Set Active Overworld from name or path
  46.     bool Set_Active( string str );
  47.     // Set Active Overworld
  48.     bool Set_Active( cOverworld *world );
  49.  
  50.     // Reset to default world first Waypoint
  51.     void Reset( void );
  52.  
  53.     // Get Overworld pointer
  54.     cOverworld *Get( string str );
  55.     // Get Overworld pointer from path
  56.     cOverworld *Get_from_Path( string path );
  57.     // Get Overworld pointer from name
  58.     cOverworld *Get_from_Name( string name );
  59.  
  60.     // Return Overworld array number
  61.     int Get_Array_Num( string path );
  62.  
  63.     // worlds descriptor filename
  64.     string worlds_filename;
  65.  
  66.     // shows additional information
  67.     bool debugmode;
  68.     // draw the layer
  69.     bool draw_layer;
  70.     // map scrolling with the arrow keys
  71.     bool cameramode;
  72.  
  73.     // world camera
  74.     cCamera *camera;
  75. private:
  76.     // XML element start
  77.     virtual void elementStart( const CEGUI::String &element, const CEGUI::XMLAttributes &attributes );
  78.     // XML element end
  79.     virtual void elementEnd( const CEGUI::String &element );
  80.     // handles a world
  81.     void handle_world( const CEGUI::XMLAttributes &attributes );
  82.  
  83.     // XML element Property list
  84.     CEGUI::XMLAttributes xml_attributes;
  85. };
  86.  
  87. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  88.  
  89. // Overworld information handler
  90. extern cOverworld_Manager *pOverworld_Manager;
  91.  
  92. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  93.  
  94. #endif
  95.