Changeset 5866 for code/branches/core5/src/libraries/core/BaseObject.h
- Timestamp:
- Oct 3, 2009, 6:32:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/BaseObject.h
r5839 r5866 152 152 virtual void changedGametype() {} 153 153 154 void addEventSource(BaseObject* source, const std::string& state); 155 void removeEventSource(BaseObject* source); 156 BaseObject* getEventSource(unsigned int index, const std::string& state) const; 157 154 158 void fireEvent(); 155 159 void fireEvent(bool activate); … … 159 163 virtual void processEvent(Event& event); 160 164 161 inline void registerEventListener(BaseObject* object, const std::string& sectionname)162 { this->eventListeners_[object] = sectionname; }163 inline void unregisterEventListener(BaseObject* object)164 { this->eventListeners_.erase(object); }165 166 void addEvent(BaseObject* event, const std::string& sectionname);167 void removeEvent(BaseObject* event);168 BaseObject* getEvent(unsigned int index) const;169 170 void addEventContainer(const std::string& sectionname, EventContainer* container);171 EventContainer* getEventContainer(const std::string& sectionname) const;172 173 165 /** @brief Sets the indentation of the debug output in the Loader. @param indentation The indentation */ 174 166 inline void setLoaderIndentation(const std::string& indentation) { this->loaderIndentation_ = indentation; } … … 177 169 178 170 protected: 171 /** @brief Adds an object which listens to the events of this object. */ 172 inline void registerEventListener(BaseObject* object) 173 { this->eventListeners_.insert(object); } 174 /** @brief Removes an event listener from this object. */ 175 inline void unregisterEventListener(BaseObject* object) 176 { this->eventListeners_.erase(object); } 177 178 void addEventContainer(const std::string& sectionname, EventContainer* container); 179 EventContainer* getEventContainer(const std::string& sectionname) const; 180 179 181 std::string name_; //!< The name of the object 180 182 std::string oldName_; //!< The old name of the object … … 197 199 BaseObject* creator_; 198 200 SmartPtr<Scene> scene_; 201 uint32_t sceneID_; 199 202 SmartPtr<Gametype> gametype_; 200 203 Gametype* oldGametype_; 201 204 std::set<Template*> templates_; 202 std::map<BaseObject*, std::string> eventListeners_;203 std:: list<BaseObject*> events_;204 std:: map<std::string, EventContainer*> eventContainers_;205 uint32_t sceneID_;205 206 std::map<BaseObject*, std::string> eventSources_; //!< List of objects which send events to this object, mapped to the state which they affect 207 std::set<BaseObject*> eventListeners_; //!< List of objects which listen to the events of this object 208 std::map<std::string, EventContainer*> eventContainers_; 206 209 }; 207 210
Note: See TracChangeset
for help on using the changeset viewer.