Eris 1.3.18
|
View encapsulates the set of entities currently visible to an Avatar, as well as those that have recently been seen. More...
#include <View.h>
Classes | |
class | FactoryOrdering |
Public Types | |
typedef sigc::slot< void, Entity * > | EntitySightSlot |
Public Member Functions | |
View (Avatar *av) | |
Entity * | getEntity (const std::string &eid) const |
Retrieve an entity in the view by id. | |
Avatar * | getAvatar () const |
Entity * | getTopLevel () 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::signal< void, Entity * > | EntitySeen |
emitted whenever the View creates a new Entity instance. | |
sigc::signal< void, Entity * > | EntityCreated |
emitted when a SIGHT(CREATE) op is received for an entity | |
sigc::signal< void, Entity * > | EntityDeleted |
emitted when a SIGHT(DELETE) op is received 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 | ViewEntity |
class | Avatar |
class | Task |
View encapsulates the set of entities currently visible to an Avatar, as well as those that have recently been seen.
It receives visibility-affecting ops from the IGRouter, and uses them to update its state and emit signals.
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.
References Eris::Entity::getId().
Referenced by Eris::ViewEntity::shutdown().
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.
Referenced by Eris::Avatar::Avatar(), and Eris::ViewEntity::getEntity().
Entity* Eris::View::getTopLevel | ( | ) | const [inline] |
return the current top-level entity.
This will return NULL until the first emission of the TopLevelEntityChanged signal.
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)
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)
void Eris::View::taskRateChanged | ( | Task * | t | ) | [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.
Referenced by Eris::ViewEntity::task_ProgressRateChanged().
void Eris::View::update | ( | ) |
sigc::signal<void, Entity*> Eris::View::EntitySeen |