Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/util/object_manager.h @ 8015

Last change on this file since 8015 was 7836, checked in by bensch, 19 years ago

trunk: merged the Atmos back again, because a ClassID was wrong

File size: 3.0 KB
RevLine 
[4838]1/*!
[5629]2 * @file object_manager.h
[6142]3 * @brief Definition of the ObjectManager.
4 */
[3655]5
[5629]6#ifndef _OBJECT_MANAGER_H
7#define _OBJECT_MANAGER_H
[3655]8
9#include "base_object.h"
[5682]10#include <list>
[6142]11#include <vector>
[3655]12
[6142]13/// Enumerator for Managed Object Lists
14typedef enum {
15  OM_NULL             =  0,
16  OM_DEAD,
17  OM_DEAD_TICK,
18  OM_ENVIRON_NOTICK,
19  OM_ENVIRON,
[7836]20  OM_BACKGROUND,
[6142]21  OM_COMMON,
[3655]22
[6142]23  OM_GROUP_00,
24  OM_GROUP_00_PROJ,
25  OM_GROUP_01,
26  OM_GROUP_01_PROJ,
27  OM_GROUP_02,
28  OM_GROUP_02_PROJ,
29  OM_GROUP_03,
30  OM_GROUP_03_PROJ,
31  OM_GROUP_04,
32  OM_GROUP_04_PROJ,
33  OM_GROUP_05,
34  OM_GROUP_05_PROJ,
35  OM_GROUP_06,
36  OM_GROUP_06_PROJ,
37  OM_GROUP_07,
38  OM_GROUP_07_PROJ,
39  OM_GROUP_08,
40  OM_GROUP_08_PROJ,
41  OM_GROUP_09,
42  OM_GROUP_09_PROJ,
43  OM_GROUP_10,
44  OM_GROUP_10_PROJ,
45  OM_GROUP_11,
46  OM_GROUP_11_PROJ,
47  OM_GROUP_12,
48  OM_GROUP_12_PROJ,
49  OM_GROUP_13,
50  OM_GROUP_13_PROJ,
51  OM_GROUP_14,
52  OM_GROUP_14_PROJ,
53  OM_GROUP_15,
54  OM_GROUP_15_PROJ,
[5682]55
[6142]56  OM_SIZE,
[5682]57
58
[6142]59  OM_INIT             = -1, //!< DO NOT USE THIS. (WorldEntity Internal).
60} OM_LIST;
[5682]61
[6142]62#define OM_DEFAULT_LIST  OM_NULL
[5682]63
[6142]64
65// FORWARD DECLARATION
66class PNode;
67class WorldEntity;
68
69//! A powerfull handler for the Object (WorldEntities) in the World.
[7368]70class ObjectManager : public BaseObject
71{
72public:
73  typedef std::list<WorldEntity*> EntityList;      //!< A type definition to make it easy to use EntityLists.
[3655]74
[7368]75  ObjectManager();
76  virtual ~ObjectManager();
[3655]77
[6142]78  void flush();
[5682]79
[6142]80  void toList (WorldEntity* entity, OM_LIST omList = OM_DEFAULT_LIST);
[7221]81  void toList (WorldEntity* entity, const std::string& omList);
[6142]82
83
[7368]84  /** @returns the List (listnumber) of objects. @param listNumber the List to get. */
85  EntityList& getObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; }
86  /** @returns a constant LIST of Objects. @param listNumber the objectList to returns */
87  const EntityList& getObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; }
[6142]88
[7368]89  static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID);
[5795]90
[6142]91  void debug(OM_LIST omList, unsigned int level = 0) const;
[7221]92  void debug(const std::string& listName = "", unsigned int level = 0);
[5682]93
[7221]94  static OM_LIST StringToOMList(const std::string& listName);
[6142]95  static const char* OMListToString(OM_LIST omList);
96
[7785]97
98  void toReflectionList( WorldEntity* entity) { this->reflectionList.push_back(entity); }
99  /** @returns the list of all reflected objects in the world */
100  EntityList& getReflectionList() { return this->reflectionList; }
101  /** @returns the static list of all reflected objects in the world */
102  const EntityList& getReflectionList() const { return this->reflectionList; }
103
104
105
106
[7368]107private:
108  const std::list<BaseObject>*            pNodeList;                //!< The List of PNodes.
[5682]109
[7368]110  EntityList                              objectLists[OM_SIZE];     //!< The ObjectLists.
[5682]111
[6142]112  static const char*                      objectManagerListNames[]; //!< Names of all the lists
[7785]113
114  EntityList                              reflectionList;           //!< A list of all reflected objects in the world
[3655]115};
116
[5629]117#endif /* _OBJECT_MANAGER_H */
Note: See TracBrowser for help on using the repository browser.