00001 /* 00002 This file is part of c0re. 00003 00004 c0re is a multiplayer RTS on a hexagonal map with an evolving unit concept. 00005 Copyright (C) 2007 Stephan Hofmann 00006 00007 c0re is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef _LEVEL_H_ 00022 #define _LEVEL_H_ 00023 00024 #include <map> 00025 #include <list> 00026 00027 #include "GLInterface.h" 00028 #include "Field.h" 00029 #include "FunctionHandler.h" 00030 #include "CyclicList.h" 00031 00032 class Window; 00033 class Player; 00034 class Interface; 00035 class EventInterface; 00036 class Network; 00037 00041 class Level : public GLInterface 00042 { 00043 public: 00049 Level(Window *p_window); 00050 00054 virtual ~Level(); 00055 00062 int load(std::string p_filename); 00063 00069 int init(); 00070 00076 int run(); 00077 00083 int compute(); 00084 00092 bool setVisible(unsigned int p_x, unsigned int p_y); 00093 00099 int computeVisibility(); 00100 00106 int renderScene(bool p_normal = true); 00107 00113 int renderInterface(); 00114 00120 int initViewCamera(bool resetMatrix = true); 00121 00127 int initViewInterface(bool resetMatrix = true); 00128 00134 int pick(); 00135 00141 bool checkInput(); 00142 00146 std::vector< std::vector<Field*> > grid; 00147 00151 std::map<std::string, Player*> players; 00152 00156 Interface *playerInterface; 00157 00161 std::map<std::string, std::string> bindings; 00162 00166 FunctionMap functions; 00167 00171 std::list<std::string> currentCommands; 00172 00176 std::list<std::string> singleCommands; 00177 00186 int createWindow(int p_width, int p_height, bool p_fullscreen = false); 00187 00193 virtual int initGL(); 00194 00200 int setViewportCamera (); 00201 00208 int setViewportInterface (); 00209 00213 Vector3d position; 00214 00218 Vector3i mousePos; 00219 00223 long round; 00224 00228 std::list<Texture*> effects; 00229 00233 CyclicList< std::list< EventInterface* > > eventList; 00234 00238 Network* network; 00239 00243 static const unsigned int roundTime; 00244 00248 static const int interfaceSizeWidth; 00249 00253 static const int interfaceSizeHeight; 00254 00255 }; 00256 00257 00258 #endif;