Eris::View Class Reference

View encapsulates the set of entities currently visible to an Avatar, as well as those that have recently been seen. More...

#include <View.h>

List of all members.

Public Types

typedef sigc::slot< void,
Entity * > 
EntitySightSlot

Public Member Functions

 View (Avatar *av)
EntitygetEntity (const std::string &eid) const
 Retrieve an entity in the view by id.
AvatargetAvatar () const
EntitygetTopLevel () const
 return the current top-level entity.
void update ()
 once-per-frame update of the View - clients should call this method once per game loop (or similar), to allow the View to update Entity state.
void registerFactory (Factory *)
 Register an Entity Factory with this view.
sigc::connection notifyWhenEntitySeen (const std::string &eid, const EntitySightSlot &slot)
 Conenct up a slot to be fired when an Entity with the specified ID is seen.
void dumpLookQueue ()
unsigned int lookQueueSize () const
 Retrieve the current look queue size, for debugging / statistics purposes.

Public Attributes

SigC::Signal1< void, Entity * > EntitySeen
 emitted whenever the View creates a new Entity instance.
SigC::Signal1< void, Entity * > EntityCreated
 emitted when a SIGHT(CREATE) op is recieved for an entity
sigc::signal< void, Entity * > EntityDeleted
 emitted when a SIGHT(DELETE) op is recieved for an entity
sigc::signal< void, Entity * > Appearance
sigc::signal< void, Entity * > Disappearance
sigc::signal< void > TopLevelEntityChanged
 emitted when the TLVE changes

Protected Member Functions

void appear (const std::string &eid, float stamp)
void disappear (const std::string &eid)
void sight (const Atlas::Objects::Entity::RootEntity &ge)
void create (const Atlas::Objects::Entity::RootEntity &ge)
void deleteEntity (const std::string &eid)
void unseen (const std::string &eid)
void setEntityVisible (Entity *ent, bool vis)
bool isPending (const std::string &eid) const
 test if the specified entity ID is pending initial sight on the View
void addToPrediction (Entity *ent)
void removeFromPrediction (Entity *ent)
void entityDeleted (Entity *ent)
 this is a hook that Entity's destructor calls to remove itself from the View's content map.
void taskRateChanged (Task *)
 Method to register and unregister tasks with with view, so they can have their progress updated automatically by update().

Friends

class IGRouter
class Entity
class Avatar
class Task

Classes

class  FactoryOrdering


Detailed Description

View encapsulates the set of entities currently visible to an Avatar, as well as those that have recently been seen.

It recieves visibility-affecting ops from the IGRouter, and uses them to update its state and emit signals.


Member Function Documentation

Entity * Eris::View::getEntity ( const std::string &  eid  )  const

Retrieve an entity in the view by id.

Returns NULL if no such entity exists in the view.

Entity* Eris::View::getTopLevel (  )  const [inline]

return the current top-level entity.

This will return NULL until the first emission of the TopLevelEntityChanged signal.

void Eris::View::update (  ) 

once-per-frame update of the View - clients should call this method once per game loop (or similar), to allow the View to update Entity state.

This includes motion prediction for moving entities, and confidence levels for disappeared entities.

sigc::connection Eris::View::notifyWhenEntitySeen ( const std::string &  eid,
const EntitySightSlot &  slot 
)

Conenct up a slot to be fired when an Entity with the specified ID is seen.

If the entity is already visible, this is a no-op (and will log an error)

unsigned int Eris::View::lookQueueSize (  )  const [inline]

Retrieve the current look queue size, for debugging / statistics purposes.

Eg, this could be displayed as a bar-chart on screen in a client (optionally)

void Eris::View::entityDeleted ( Entity ent  )  [protected]

this is a hook that Entity's destructor calls to remove itself from the View's content map.

The name is unfortantely similar to the public 'EntityDeleted' signal - alternative naming suggestions appreciated.

void Eris::View::taskRateChanged ( Task *   )  [protected]

Method to register and unregister tasks with with view, so they can have their progress updated automatically by update().

Only certain tasks (those with linear progress) are handled this way, but all tasks are submitted to this method.


Member Data Documentation

SigC::Signal1<void, Entity*> Eris::View::EntitySeen

emitted whenever the View creates a new Entity instance.

This signal is emitted once the entity has been fully bound into the View


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 18:51:19 2007 for Eris by  doxygen 1.5.2