Eris  1.3.21
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
Eris::ViewEntity Class Reference

An entity which is bound to an Eris::View. More...

#include <ViewEntity.h>

Inheritance diagram for Eris::ViewEntity:
Eris::Entity

List of all members.

Public Member Functions

 ViewEntity (const std::string &id, TypeInfo *ty, View *view)
 Ctor.
virtual void shutdown ()
 Shuts down the entity.
virtual ViewgetView () const
 Gets the view to which this entity belongs, if any.

Protected Member Functions

virtual void onTalk (const Atlas::Objects::Operation::RootOperation &talk)
 process TALK data - default implementation emits the Say signal.
virtual void onSoundAction (const Atlas::Objects::Operation::RootOperation &op)
 Over-rideable hook when this entity is heard performing an action.
virtual void onVisibilityChanged (bool vis)
 over-rideable hook when the actual (computed) visiblity of this entity changed.
virtual void onTaskAdded (Task *task)
 Over-rideable hook for when tasks are added.
virtual void removeFromMovementPrediction ()
 Removes the entity from any movement prediction service.
virtual void addToMovementPredition ()
 Adds the entity to any movement prediction service.
virtual EntitygetEntity (const std::string &id)
 Gets an entity with the supplied id from the system.
virtual TypeServicegetTypeService () const
 Gets the typeservice used throughout the Eris system.
void task_ProgressRateChanged (Task *task)
 Listen to task progress rates updates and send to the view.

Protected Attributes

Viewm_view
 The View which owns this Entity.
EntityRouterm_router
 A router instance which routes messages from the view into this entity.

Friends

class EntityRouter

Detailed Description

An entity which is bound to an Eris::View.

This subclass of Eris::Entity is intimately bound to a View. As Atlas messages are received from the server these will be routed into an instance of this class.

In your client this is the class you would want to work with for any entities which represents entities that are on the server. If you however are working with entities that aren't represented on the server (the typical example would be if you're allowing client side authoring where you want to create entities locally) you would instead want to implement a new class which inherits Eris::Entity.


Constructor & Destructor Documentation

Eris::ViewEntity::ViewEntity ( const std::string &  id,
TypeInfo ty,
View view 
)

Ctor.

Parameters:
idThe id of the entity.
tyType info for the entity.
viewThe view to which the entity belongs.

References m_router, and m_view.


Member Function Documentation

void Eris::ViewEntity::addToMovementPredition ( ) [protected, virtual]

Adds the entity to any movement prediction service.

This is called when movement has started.

Implements Eris::Entity.

References m_view.

Entity * Eris::ViewEntity::getEntity ( const std::string &  id) [protected, virtual]

Gets an entity with the supplied id from the system.

Parameters:
idThe id of the entity to get.

Implements Eris::Entity.

References Eris::View::getEntity(), and m_view.

TypeService * Eris::ViewEntity::getTypeService ( ) const [protected, virtual]

Gets the typeservice used throughout the Eris system.

Returns:
A type service instance.

Implements Eris::Entity.

References m_view.

View * Eris::ViewEntity::getView ( ) const [inline, virtual]

Gets the view to which this entity belongs, if any.

Returns:
The view to which this entity belongs, or null if this entity isn't connected to any view.

References m_view.

void Eris::ViewEntity::onSoundAction ( const Atlas::Objects::Operation::RootOperation &  op) [protected, virtual]

Over-rideable hook when this entity is heard performing an action.

Default implementation emits the Noise signal.

Reimplemented from Eris::Entity.

References Eris::Avatar::Hear, and m_view.

void Eris::ViewEntity::onTalk ( const Atlas::Objects::Operation::RootOperation &  talk) [protected, virtual]

process TALK data - default implementation emits the Say signal.

Parameters:
talkThe TALK operation

Reimplemented from Eris::Entity.

References Eris::Avatar::Hear, and m_view.

void Eris::ViewEntity::onTaskAdded ( Task task) [protected, virtual]

Over-rideable hook for when tasks are added.

Parameters:
taskThe new task.

Reimplemented from Eris::Entity.

References task_ProgressRateChanged().

void Eris::ViewEntity::onVisibilityChanged ( bool  vis) [protected, virtual]

over-rideable hook when the actual (computed) visiblity of this entity changed.

The default implementation emits the VisiblityChanged signal.

Reimplemented from Eris::Entity.

References m_view.

void Eris::ViewEntity::removeFromMovementPrediction ( ) [protected, virtual]

Removes the entity from any movement prediction service.

This is called when movement has stopped.

Implements Eris::Entity.

References m_view.

void Eris::ViewEntity::shutdown ( ) [virtual]

Shuts down the entity.

A call to this must be made before the entity is deleted. In normal operations, where Eris itself takes care of the entities, it will be called automatically. If you however manually handle instance of this in your code you must call it yourself.

Reimplemented from Eris::Entity.

References Eris::View::entityDeleted(), Eris::Entity::m_id, m_router, and m_view.

void Eris::ViewEntity::task_ProgressRateChanged ( Task task) [protected]

Listen to task progress rates updates and send to the view.

Parameters:
taskThe task which is changed.

References m_view, and Eris::View::taskRateChanged().

Referenced by onTaskAdded().


The documentation for this class was generated from the following files: