00001 /* 00002 Teem - an open source evolutionary software framework 00003 http://lis.epfl.ch/resources/Teem 00004 Stephane Magnenat <stephane.magnenat@epfl.ch>, 00005 Antoine Beyeler <antoine.beyeler@epfl.ch>, 00006 and other contributors. See AUTHORS for details 00007 Laboratory of Intelligent Systems, EPFL, Lausanne 00008 00009 This program is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; either version 2 of the License, or 00012 (at your option) any later version. 00013 00014 This program is 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 this program; if not, write to the Free Software 00021 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00022 */ 00023 00024 #ifndef __TEEM_WORLD_H 00025 #define __TEEM_WORLD_H 00026 00027 #include <an/Types.h> 00028 #include <an/Geometry.h> 00029 00038 namespace Teem 00039 { 00042 class WorldCapability 00043 { 00044 public: 00046 virtual ~WorldCapability() { } 00047 }; 00048 00049 class Sbot; 00050 00053 class SbotCreator : public WorldCapability 00054 { 00055 public: 00056 virtual ~SbotCreator() { } 00058 virtual Sbot *createSbot() = 0; 00059 }; 00060 00061 class SbotActiveObject; 00062 00065 class SbotActiveObjectCreator : public WorldCapability 00066 { 00067 public: 00068 virtual ~SbotActiveObjectCreator() { } 00070 virtual SbotActiveObject *createSbotActiveObject() = 0; 00071 }; 00072 00073 class Alice; 00074 00077 class AliceCreator : public WorldCapability 00078 { 00079 public: 00080 virtual ~AliceCreator() { } 00082 virtual Alice *createAlice() = 0; 00083 }; 00084 00085 class AliceSmallDisk; 00086 00089 class AliceSmallDiskCreator : public WorldCapability 00090 { 00091 public: 00092 virtual ~AliceSmallDiskCreator() { } 00094 virtual AliceSmallDisk *createAliceSmallDisk() = 0; 00095 }; 00096 00097 class AliceLargeDisk; 00098 00101 class AliceLargeDiskCreator : public WorldCapability 00102 { 00103 public: 00104 virtual ~AliceLargeDiskCreator() { } 00106 virtual AliceLargeDisk *createAliceLargeDisk() = 0; 00107 }; 00108 00109 class AliceBlock; 00110 00113 class AliceBlockCreator: public WorldCapability 00114 { 00115 public: 00116 virtual ~AliceBlockCreator() {} 00118 virtual AliceBlock *createAliceBlock(bool high) = 0; 00119 }; 00120 00121 class Khepera; 00122 00125 class KheperaCreator : public WorldCapability 00126 { 00127 public: 00128 virtual ~KheperaCreator() { } 00130 virtual Khepera *createKhepera() = 0; 00131 }; 00132 00133 class Blimp; 00136 class BlimpCreator : public WorldCapability 00137 { 00138 public: 00139 virtual ~BlimpCreator() { } 00141 virtual Blimp* createBlimp() = 0; 00142 }; 00143 00144 class RectangularBlock; 00145 00148 class RectangularBlockCreator : public WorldCapability 00149 { 00150 public: 00151 virtual ~RectangularBlockCreator() { } 00153 virtual RectangularBlock *createRectangularBlock() = 0; 00154 }; 00155 00156 00159 class World 00160 { 00161 public: 00163 virtual ~World() { } 00165 template<class C> 00166 C *getCapability(void) { return dynamic_cast<C *>(this); } 00168 virtual void step(double dt) = 0; 00169 }; 00170 00173 class ArenaWorld : public World 00174 { 00175 public: 00176 virtual ~ArenaWorld() { } 00177 }; 00178 00181 class SquareArenaWorld : public ArenaWorld 00182 { 00183 public: 00184 virtual ~SquareArenaWorld() { } 00186 virtual An::Point getDimension() = 0; 00188 virtual void setWallTextures(const std::valarray<An::Texture> &textures) = 0; 00190 virtual void useWalls(bool use) = 0; 00191 }; 00192 } 00193 00194 #endif