![]() |
Public API Reference |
#include <objwatch.h>
Inheritance diagram for iObjectWatcher:
Public Methods | |
virtual void | WatchLight (iLight *light)=0 |
Add a light to watch. More... | |
virtual void | RemoveLight (iLight *light)=0 |
Remove a light to watch. More... | |
virtual int | GetWatchedLightCount () const=0 |
Get the number of watched lights. More... | |
virtual iLight * | GetLight (int idx)=0 |
Get the specified watched light. More... | |
virtual void | WatchMovable (iMovable *movable)=0 |
Add a movable to watch. More... | |
virtual void | RemoveMovable (iMovable *movable)=0 |
Remove a movable to watch. More... | |
virtual int | GetWatchedMovableCount () const=0 |
Get the number of watched movables. More... | |
virtual iMovable * | GetMovable (int idx)=0 |
Get the specified watched movable. More... | |
virtual void | Reset ()=0 |
Reset. Remove all watched objects from this watcher. More... | |
virtual uint32 | GetWatchNumber () const=0 |
Get the current number for his watcher. More... | |
virtual int | GetLastOperation () const=0 |
Get the last operation that occured. More... | |
virtual iLight * | GetLastLight () const=0 |
Get the last light. More... | |
virtual iMovable * | GetLastMovable () const=0 |
Get the last movable. More... | |
virtual void | AddListener (iObjectWatcherListener *cb)=0 |
Add a listener to this object watcher. More... | |
virtual void | RemoveListener (iObjectWatcherListener *cb)=0 |
Remove a listener. More... |
Currently it can watch on light and movable changes. You can query if something has changed by examining the 'number' or else you can register a listener and get notified when one of the objects changes. This object will not keep real references to the objects it is watching but it will clean up the watcher for some object if that object is removed.
Definition at line 81 of file iengine/objwatch.h.
|
Add a listener to this object watcher. This will call IncRef() on the listener So make sure you call DecRef() to release your own reference. Implemented in csObjectWatcher. |
|
Get the last light. Only valid if the last operation (GetLastOperation()) is one of CS_WATCH_LIGHT_.... Implemented in csObjectWatcher. |
|
Get the last movable. Only valid if the last operation (GetLastOperation()) is one of CS_WATCH_MOVABLE_.... Implemented in csObjectWatcher. |
|
Get the last operation that occured. This will be one of:
Implemented in csObjectWatcher. |
|
Get the specified watched light.
Implemented in csObjectWatcher. |
|
Get the specified watched movable.
Implemented in csObjectWatcher. |
|
Get the number of watched lights.
Implemented in csObjectWatcher. |
|
Get the number of watched movables.
Implemented in csObjectWatcher. |
|
Get the current number for his watcher. This number will increase as soon as some of the watched objects change. When this happens you can query the last change (only the last change!) by calling GetLastOperation() and/or GetLastLight() or GetLastMovable(). Note that if the operation indicates that something is destroyed then you should no longer use the pointer returned by GetLastLight() or GetLastMovable() as the object will already be gone by then. You can only use the returned pointer to clean up from internal data structures. Implemented in csObjectWatcher. |
|
Remove a light to watch.
Implemented in csObjectWatcher. |
|
Remove a listener.
Implemented in csObjectWatcher. |
|
Remove a movable to watch.
Implemented in csObjectWatcher. |
|
Reset. Remove all watched objects from this watcher.
Implemented in csObjectWatcher. |
|
Add a light to watch.
Implemented in csObjectWatcher. |
|
Add a movable to watch.
Implemented in csObjectWatcher. |