Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 9085 was 8068, checked in by patrick, 19 years ago

trunk: merged the network branche back to trunk

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