Sion Tower (demo técnica) 0.1

/home/david/programacion/iberogre-siontower/siontower/trunk/src/include/level.h

00001 /*
00002  * This file is part of SionTower.
00003  *
00004  * 
00005  * David Saltares Márquez (C) 2011
00006  * <david.saltares@gmail.com>
00007  *
00008  * 
00009  * SionTower examples are free software: you can redistribute it and/or
00010  * modify it under the terms of the GNU General Public License ad
00011  * published by the Free Software Foundation, either version 3 of the
00012  * License, or (at your option) ant later version.
00013  *
00014  * SionTower examples are distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with SionTower examples.  If not, see <http://www.gnu.org/licenses/>.
00021  */
00022 
00023 
00024 #ifndef SIONTOWER_TRUNK_SRC_INCLUDE_LEVEL_H_
00025 #define SIONTOWER_TRUNK_SRC_INCLUDE_LEVEL_H_
00026 
00027 #include <vector>
00028 
00029 #include <OGRE/Ogre.h>
00030 #include "pugixml.hpp"
00031 
00032 #include "song.h"
00033 
00034 class GameObject;
00035 class Player;
00036 
00038 
00039 
00054 class Level {
00055     public:
00066         Level(const Ogre::String& id);
00067 
00071         ~Level();
00072 
00077         void load();
00078 
00083         void unload();
00084 
00089         bool isLoaded() const;
00090 
00094         const Ogre::String& getId() const;
00095 
00099         const Ogre::String& getName() const;
00100 
00104         const Ogre::String& getDescription() const;
00105 
00110         const Ogre::String& getSongName() const;
00111 
00115         SongPtr getSong();
00116 
00120         std::vector<GameObject*>& getSceneObjects();
00121         
00125         const Ogre::Vector3& getPlayerPosition() const;
00126         
00127     private:
00128         Ogre::String _id;
00129         Ogre::String _name;
00130         Ogre::String _description;
00131         Ogre::String _musicName;
00132         Ogre::String _musicGroup;
00133         bool _loaded;
00134         SongPtr _song;
00135         Player* _player;
00136         std::vector<GameObject*> _sceneObjects;
00137         std::vector<std::pair <Ogre::SceneNode*, Ogre::Light*> > _lights;
00138         Ogre::Vector3 _playerPos;
00139         
00140         void loadBasicInfo();
00141 
00142         void loadAmbientInfo(const pugi::xml_document& doc);
00143         void loadNodesInfo(const pugi::xml_document& doc);
00144         void loadEntity(const pugi::xml_node& node, Ogre::SceneNode* sceneNode);
00145         void loadLight(const pugi::xml_node& node, Ogre::SceneNode* sceneNode);
00146 };
00147 
00148 #endif  // SIONTOWER_TRUNK_SRC_INCLUDE_LEVEL_H_
 Todo Clases Archivos Funciones 'typedefs' Enumeraciones