Base class for objects involved in the simulation. @section simobject_intro Introduction SimObject is a base class for most of the classes you'll encounter working in Torque. It provides fundamental services allowing "smart" object referencing, creation, destruction, organization, and location. Along with SimEvent, it gives you a flexible event-scheduling system, as well as laying the foundation
| 234 | /// |
| 235 | /// @nosubgrouping |
| 236 | class SimObject: public ConsoleObject, public TamlCallbacks |
| 237 | { |
| 238 | public: |
| 239 | |
| 240 | typedef ConsoleObject Parent; |
| 241 | |
| 242 | friend class SimManager; |
| 243 | friend class SimGroup; |
| 244 | friend class SimNameDictionary; |
| 245 | friend class SimManagerNameDictionary; |
| 246 | friend class SimIdDictionary; |
| 247 | |
| 248 | /// @name Notification |
| 249 | /// @{ |
| 250 | |
| 251 | struct Notify |
| 252 | { |
| 253 | enum Type |
| 254 | { |
| 255 | ClearNotify, ///< Notified when the object is cleared. |
| 256 | DeleteNotify, ///< Notified when the object is deleted. |
| 257 | ObjectRef, ///< Cleverness to allow tracking of references. |
| 258 | Invalid ///< Mark this notification as unused (used in freeNotify). |
| 259 | } type; |
| 260 | |
| 261 | void *ptr; ///< Data (typically referencing or interested object). |
| 262 | Notify *next; ///< Next notification in the linked list. |
| 263 | }; |
| 264 | |
| 265 | /// @} |
| 266 | |
| 267 | /// Flags passed to SimObject::write |
| 268 | enum WriteFlags |
| 269 | { |
| 270 | SelectedOnly = BIT( 0 ), ///< Indicates that only objects marked as selected should be outputted. Used in SimSet. |
| 271 | NoName = BIT( 1 ), ///< Indicates that the object name should not be saved. |
| 272 | IgnoreCanSave = BIT( 2 ), ///< Write out even if CannotSave=true. |
| 273 | }; |
| 274 | |
| 275 | private: |
| 276 | |
| 277 | /// Flags for use in mFlags |
| 278 | enum |
| 279 | { |
| 280 | Deleted = BIT( 0 ), ///< This object is marked for deletion. |
| 281 | Removed = BIT( 1 ), ///< This object has been unregistered from the object system. |
| 282 | Added = BIT( 3 ), ///< This object has been registered with the object system. |
| 283 | Selected = BIT( 4 ), ///< This object has been marked as selected. (in editor) |
| 284 | Expanded = BIT( 5 ), ///< This object has been marked as expanded. (in editor) |
| 285 | ModStaticFields = BIT( 6 ), ///< The object allows you to read/modify static fields |
| 286 | ModDynamicFields = BIT( 7 ), ///< The object allows you to read/modify dynamic fields |
| 287 | AutoDelete = BIT( 8 ), ///< Delete this object when the last ObjectRef is gone. |
| 288 | CannotSave = BIT( 9 ), ///< Object should not be saved. |
| 289 | EditorOnly = BIT( 10 ), ///< This object is for use by the editor only. |
| 290 | NoNameChange = BIT( 11 ), ///< Whether changing the name of this object is allowed. |
| 291 | Hidden = BIT( 12 ), ///< Object is hidden in editors. |
| 292 | Locked = BIT( 13 ), ///< Object is locked in editors. |
| 293 | }; |
nothing calls this directly
no test coverage detected