CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csObjectWatcher Class Reference

This class implements iObjectWatcher and is capable of keeping track of lights and movables. More...

#include <objwatch.h>

Inheritance diagram for csObjectWatcher:

iObjectWatcher iBase List of all members.

Public Methods

 csObjectWatcher ()
 Create a default movable. More...

virtual ~csObjectWatcher ()
 Destructor. More...

virtual void WatchLight (iLight *light)
 Add a light to watch. More...

virtual void RemoveLight (iLight *light)
 Remove a light to watch. More...

virtual int GetWatchedLightCount () const
 Get the number of watched lights. More...

virtual iLightGetLight (int idx)
 Get the specified watched light. More...

virtual void WatchMovable (iMovable *movable)
 Add a movable to watch. More...

virtual void RemoveMovable (iMovable *movable)
 Remove a movable to watch. More...

virtual int GetWatchedMovableCount () const
 Get the number of watched movables. More...

virtual iMovableGetMovable (int idx)
 Get the specified watched movable. More...

virtual void Reset ()
 Reset. Remove all watched objects from this watcher. More...

virtual uint32 GetWatchNumber () const
 Get the current number for his watcher. More...

virtual int GetLastOperation () const
 Get the last operation that occured. More...

virtual iLightGetLastLight () const
 Get the last light. More...

virtual iMovableGetLastMovable () const
 Get the last movable. More...

virtual void AddListener (iObjectWatcherListener *cb)
 Add a listener to this object watcher. More...

virtual void RemoveListener (iObjectWatcherListener *cb)
 Remove a listener. More...


Detailed Description

This class implements iObjectWatcher and is capable of keeping track of lights and movables.

Definition at line 35 of file csengine/objwatch.h.


Constructor & Destructor Documentation

csObjectWatcher::csObjectWatcher  
 

Create a default movable.

virtual csObjectWatcher::~csObjectWatcher   [virtual]
 

Destructor.


Member Function Documentation

virtual void csObjectWatcher::AddListener iObjectWatcherListener   cb [inline, virtual]
 

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.

Implements iObjectWatcher.

Definition at line 89 of file csengine/objwatch.h.

References csRefArray::Push.

virtual iLight* csObjectWatcher::GetLastLight   const [inline, virtual]
 

Get the last light.

Only valid if the last operation (GetLastOperation()) is one of CS_WATCH_LIGHT_....

Implements iObjectWatcher.

Definition at line 86 of file csengine/objwatch.h.

virtual iMovable* csObjectWatcher::GetLastMovable   const [inline, virtual]
 

Get the last movable.

Only valid if the last operation (GetLastOperation()) is one of CS_WATCH_MOVABLE_....

Implements iObjectWatcher.

Definition at line 87 of file csengine/objwatch.h.

virtual int csObjectWatcher::GetLastOperation   const [inline, virtual]
 

Get the last operation that occured.

This will be one of:

Implements iObjectWatcher.

Definition at line 85 of file csengine/objwatch.h.

virtual iLight* csObjectWatcher::GetLight int    idx [virtual]
 

Get the specified watched light.

Implements iObjectWatcher.

virtual iMovable* csObjectWatcher::GetMovable int    idx [virtual]
 

Get the specified watched movable.

Implements iObjectWatcher.

virtual int csObjectWatcher::GetWatchedLightCount   const [inline, virtual]
 

Get the number of watched lights.

Implements iObjectWatcher.

Definition at line 74 of file csengine/objwatch.h.

References csPArray::Length.

virtual int csObjectWatcher::GetWatchedMovableCount   const [inline, virtual]
 

Get the number of watched movables.

Implements iObjectWatcher.

Definition at line 79 of file csengine/objwatch.h.

References csPArray::Length.

virtual uint32 csObjectWatcher::GetWatchNumber   const [inline, virtual]
 

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.

Implements iObjectWatcher.

Definition at line 84 of file csengine/objwatch.h.

References uint32.

virtual void csObjectWatcher::RemoveLight iLight   light [virtual]
 

Remove a light to watch.

Implements iObjectWatcher.

virtual void csObjectWatcher::RemoveListener iObjectWatcherListener   cb [inline, virtual]
 

Remove a listener.

Implements iObjectWatcher.

Definition at line 94 of file csengine/objwatch.h.

References csRefArray::Delete.

virtual void csObjectWatcher::RemoveMovable iMovable   movable [virtual]
 

Remove a movable to watch.

Implements iObjectWatcher.

virtual void csObjectWatcher::Reset   [virtual]
 

Reset. Remove all watched objects from this watcher.

Implements iObjectWatcher.

virtual void csObjectWatcher::WatchLight iLight   light [virtual]
 

Add a light to watch.

Implements iObjectWatcher.

virtual void csObjectWatcher::WatchMovable iMovable   movable [virtual]
 

Add a movable to watch.

Implements iObjectWatcher.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14