Class hierarchy Compound list File list Compound Members
Object Class Reference
Generic object class. More...
Inherited by World.
List of all members.
Public Members
- Object (World* W, Object* Parent)
- Construct an object.
- virtual ~Object ()
- Destroys an object.
- virtual int getID ()
- Returns the object's ID.
- virtual long render ()
- Subclases must override this to supply rendering.
- virtual long advance (float Fraction)
- Subclasses may override this to provide state changes.
- long handleEvent (Event* E)
- Accepts events and places them in a queue.
- long getProperty (Property& P)
- These two methods allow access to the object's properties.
- long setProperty (Property* P)
- Sets a propery.
- long hasMoreEvents ()
- Checks the event queue for events to process.
- Event* peekEvent ()
- Returns an event to process, without removing it from the queue.
- void popEvent ()
- Removes the next event from the queue.
- virtual Enumeration objects ()
- Returns a current enumeration of all son objects.
- virtual long hasSons ()
- Returns non zero if object has son objects.
- virtual long preRender ()
- This method is called once before any rendering is done.
- virtual long preObjectRender (Object* O)
- This method is called once per object before it is rendered.
- virtual long postRender ()
- This method is called once after all rendering is done.
- virtual long postObjectRender (Object* O)
- This method is called once per object after it is rendered.
- virtual long preAdvance (float Fraction)
- This method is called once before any object is advanced.
- virtual long preObjectAdvance (Object* O, float Fraction)
- This method is called once per object before it is advanced A non-zero return value means, that the object requests to be removed.
- virtual long postAdvance (float Fraction)
- This method is called once after any object is advanced.
- virtual long postObjectAdvance (Object* O, float Fraction)
- This method is called once per object after it is advanced.
- virtual long add (Object* O)
- Add an object to this parent.
- void remove ()
- Remove this object.
- virtual Object* getSon (int ID)
- Gets an object by its number (Use O->getID() to retrieve number) This is useful, instead of keeping pointers to objects, since objects may be deleted and then pointers are invalid.
- virtual Object* getParent ()
- Get the object's parent.
Static Public Members
- Object* get (int ID)
- This method gets an object anywhere in the system.
Protected Members
- virtual void setParent (Object* Parent)
- Sets the object's parent.
- virtual long removeNow (Object* O)
- Removes a son.
Detailed Description
Generic object class.
Can represent any entity in the program,
and is not tied to any environment.
All world objects should be subclasses of this one.
Member Function Documentation
Object::Object(World* W, Object* Parent)
Construct an object.
Parent can be NULL, in which case it is set to the world object.
virtual Object::~Object() [virtual]
virtual int Object::getID() [virtual]
virtual long Object::render() [virtual]
Subclases must override this to supply rendering.
virtual long Object::advance(float Fraction) [virtual]
Subclasses may override this to provide state changes.
Fraction gives the amount of time to provide change for (in seconds)
long Object::handleEvent(Event* E)
Accepts events and places them in a queue.
long Object::getProperty(Property& P)
These two methods allow access to the object's properties.
long Object::setProperty(Property* P)
Sets a propery.
Property object must be dynamically allocated
long Object::hasMoreEvents()
Checks the event queue for events to process.
Event* Object::peekEvent()
Returns an event to process, without removing it from the queue.
void Object::popEvent()
Removes the next event from the queue.
virtual Enumeration Object::objects() [virtual]
Returns a current enumeration of all son objects.
virtual long Object::hasSons() [virtual]
Returns non zero if object has son objects.
virtual long Object::preRender() [virtual]
This method is called once before any rendering is done.
virtual long Object::preObjectRender(Object* O) [virtual]
This method is called once per object before it is rendered.
If it returns a non-zero value, the object will not be rendered.
virtual long Object::postRender() [virtual]
This method is called once after all rendering is done.
virtual long Object::postObjectRender(Object* O) [virtual]
This method is called once per object after it is rendered.
virtual long Object::preAdvance(float Fraction) [virtual]
This method is called once before any object is advanced.
virtual long Object::preObjectAdvance(Object* O, float Fraction) [virtual]
This method is called once per object before it is advanced A non-zero return value means, that the object requests to be removed.
virtual long Object::postAdvance(float Fraction) [virtual]
This method is called once after any object is advanced.
Reimplemented in World.
virtual long Object::postObjectAdvance(Object* O, float Fraction) [virtual]
This method is called once per object after it is advanced.
virtual long Object::add(Object* O) [virtual]
Add an object to this parent.
Object must be dynamically allocated
method returns the object's ID.
void Object::remove()
Remove this object.
Object will be deleted automatically, by world at the end of advance
virtual Object* Object::getSon(int ID) [virtual]
Gets an object by its number (Use O->getID() to retrieve number) This is useful, instead of keeping pointers to objects, since objects may be deleted and then pointers are invalid.
Both methods return NULL if object is not found.
This method get an object which is a direct son of the current one.
virtual Object* Object::getParent() [virtual]
Get the object's parent.
Defaults to Object's World initially
Object* Object::get(int ID) [static]
This method gets an object anywhere in the system.
virtual void Object::setParent(Object* Parent) [protected, virtual]
Sets the object's parent.
Defaults to Object's World initially
virtual long Object::removeNow(Object* O) [protected, virtual]
Removes a son.
Called by the world's postAdvance
The documentation for this class was generated from the following file: