Class hierarchy   Compound list   File list   Compound Members  

Object Class Reference

Generic object class. More...

Inherited by World.

List of all members.

Public Members

Static Public Members

Protected Members


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]

Destroys an object.

virtual int Object::getID() [virtual]

Returns the object's ID.

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: