- Timestamp:
- Apr 25, 2006, 11:37:59 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.h
r7225 r7368 82 82 static const char* paramToString(long parameter); 83 83 84 protected:85 MultiType* defaultValue; //!< Default Values.86 87 84 private: 88 85 ShellCommandClass* shellClass; //!< A Pointer to the Shell-Class this Command belongs to. -
trunk/src/story_entities/game_world.cc
r7339 r7368 23 23 #include "state.h" 24 24 #include "class_list.h" 25 #include "substring.h"26 25 27 26 #include "util/loading/game_loader.h" 28 27 29 #include "p_node.h"30 #include "world_entity.h"31 28 #include "player.h" 32 29 #include "camera.h" … … 35 32 #include "test_entity.h" 36 33 #include "terrain.h" 37 #include "md2Model.h"38 #include "world_entities/projectiles/projectile.h"39 #include "npcs/npc_test1.h"40 34 #include "playable.h" 41 35 … … 43 37 44 38 #include "util/loading/factory.h" 39 #include "util/loading/load_param.h" 45 40 #include "fast_factory.h" 46 #include "util/loading/load_param.h"47 41 #include "shell_command.h" 48 42 -
trunk/src/story_entities/game_world.h
r7339 r7368 28 28 class GameWorld : public StoryEntity 29 29 { 30 31 30 public: 32 31 GameWorld (); -
trunk/src/story_entities/game_world_data.h
r7287 r7368 10 10 #include "data_tank.h" 11 11 #include "error.h" 12 12 #include "object_manager.h" 13 13 14 14 class Camera; … … 16 16 class Terrain; 17 17 class WorldEntity; 18 class ObjectManager;19 18 20 19 class GLMenuImageScreen; … … 32 31 class GameWorldData : public DataTank 33 32 { 34 35 33 public: 36 34 GameWorldData(); … … 55 53 56 54 public: 57 GLMenuImageScreen* glmis;//!< The Level-Loader Display55 GLMenuImageScreen* glmis; //!< The Level-Loader Display 58 56 59 Camera* localCamera;//!< The current camera60 Player* localPlayer;//!< The player, you fly through the level.61 WorldEntity* sky;//!< The environmental sky of orxonox62 Terrain* terrain;//!< The terrain - ground57 Camera* localCamera; //!< The current camera 58 Player* localPlayer; //!< The player, you fly through the level. 59 WorldEntity* sky; //!< The environmental sky of orxonox 60 Terrain* terrain; //!< The terrain - ground 63 61 64 OggPlayer* music;//!< Reference to the SoundEngine's music player (OggPlayer)65 ObjectManager* objectManager;//!< Reference to the objects manager62 OggPlayer* music; //!< Reference to the SoundEngine's music player (OggPlayer) 63 ObjectManager* objectManager; //!< Reference to the objects manager 66 64 67 GameRules* gameRule; //!< Reference to the game rules of this game 65 GameRules* gameRule; //!< Reference to the game rules of this game 66 67 std::list<OM_LIST> tickLists; //!< The Lists in the GameWorld that should be ticked. 68 std::list<OM_LIST> drawLists; //!< The Lists in the GameWorld, that should be drawn. 68 69 }; 69 70 -
trunk/src/util/object_manager.cc
r7221 r7368 105 105 106 106 /** 107 * returns a new List with a list of WorldEntities of distance Radius from center108 */ 109 std::list<WorldEntity*>* ObjectManager::distanceFromObject(const PNode& center, float radius, ClassID classID)107 * @returns a new List with a list of WorldEntities of distance Radius from center 108 */ 109 void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID) 110 110 { 111 111 const std::list<BaseObject*>* objectList = ClassList::getList(classID); 112 112 if (objectList != NULL) 113 113 { 114 std::list<WorldEntity*>* newList = new std::list<WorldEntity*>;115 114 116 115 list<BaseObject*>::const_iterator node; 117 116 for (node = objectList->begin(); node != objectList->end(); node++) 118 117 if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius) 119 newList->push_back(dynamic_cast<WorldEntity*>(*node)); 120 return newList; 121 } 122 return NULL; 118 entities.push_back(dynamic_cast<WorldEntity*>(*node)); 119 } 123 120 } 124 121 -
trunk/src/util/object_manager.h
r7221 r7368 67 67 68 68 //! A powerfull handler for the Object (WorldEntities) in the World. 69 class ObjectManager : public BaseObject { 69 class ObjectManager : public BaseObject 70 { 71 public: 72 typedef std::list<WorldEntity*> EntityList; //!< A type definition to make it easy to use EntityLists. 70 73 71 public: 72 ObjectManager(); 73 virtual ~ObjectManager(); 74 ObjectManager(); 75 virtual ~ObjectManager(); 74 76 75 77 void flush(); … … 79 81 80 82 81 std::list<WorldEntity*>& getObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; } 82 const std::list<WorldEntity*>& getObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; } 83 /** @returns the List (listnumber) of objects. @param listNumber the List to get. */ 84 EntityList& getObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; } 85 /** @returns a constant LIST of Objects. @param listNumber the objectList to returns */ 86 const EntityList& getObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; } 83 87 84 static std::list<WorldEntity*>* distanceFromObject(const PNode& center, float radius, ClassID classID);88 static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID); 85 89 86 90 void debug(OM_LIST omList, unsigned int level = 0) const; … … 90 94 static const char* OMListToString(OM_LIST omList); 91 95 92 93 const std::list<BaseObject>* pNodeList; 96 private: 97 const std::list<BaseObject>* pNodeList; //!< The List of PNodes. 94 98 95 96 std::list<WorldEntity*> objectLists[OM_SIZE]; 99 EntityList objectLists[OM_SIZE]; //!< The ObjectLists. 97 100 98 101 static const char* objectManagerListNames[]; //!< Names of all the lists -
trunk/src/world_entities/projectiles/bomb.cc
r7193 r7368 183 183 void Bomb::detonate(float size) 184 184 { 185 std::list<WorldEntity*>* detonationList = ObjectManager::distanceFromObject(*this, size, CL_NPC); 186 if (detonationList != NULL) 187 { 188 while( !detonationList->empty() ) 185 ObjectManager::EntityList detonationList; 186 ObjectManager::distanceFromObject(detonationList, *this, size, CL_NPC); 187 while( !detonationList.empty() ) 189 188 { 190 detonationList ->front()->collidesWith(this, Vector(0,0,0));191 detonationList ->pop_front();189 detonationList.front()->collidesWith(this, Vector(0,0,0)); 190 detonationList.pop_front(); 192 191 } 193 delete detonationList;194 }195 192 }
Note: See TracChangeset
for help on using the changeset viewer.