5 #include <Eris/Factory.h>
6 #include <Atlas/Objects/ObjectsFwd.h>
7 #include <wfmath/timestamp.h>
10 #include <sigc++/trackable.h>
11 #include <sigc++/signal.h>
12 #include <sigc++/slot.h>
13 #include <sigc++/connection.h>
33 class View :
public sigc::trackable
69 typedef sigc::slot<void, Entity*> EntitySightSlot;
87 sigc::signal<void, Entity*> Appearance;
88 sigc::signal<void, Entity*> Disappearance;
101 return m_lookQueue.size();
110 void appear(
const std::string& eid,
float stamp);
111 void disappear(
const std::string& eid);
112 void sight(
const Atlas::Objects::Entity::RootEntity& ge);
113 void create(
const Atlas::Objects::Entity::RootEntity& ge);
114 void deleteEntity(
const std::string& eid);
115 void unseen(
const std::string& eid);
117 void setEntityVisible(
Entity* ent,
bool vis);
120 bool isPending(
const std::string& eid)
const;
122 void addToPrediction(
Entity* ent);
123 void removeFromPrediction(
Entity* ent);
138 Entity* initialSight(
const Atlas::Objects::Entity::RootEntity& ge);
141 void getEntityFromServer(
const std::string& eid);
144 void setTopLevelEntity(
Entity* newTopLevel);
146 Entity* createEntity(
const Atlas::Objects::Entity::RootEntity&);
153 void sendLookAt(
const std::string& eid);
159 void issueQueuedLook();
161 void eraseFromLookQueue(
const std::string& eid);
163 typedef std::map<std::string, Entity*> IdEntityMap;
166 IdEntityMap m_contents;
168 WFMath::TimeStamp m_lastUpdateTime;
170 sigc::signal<void, Entity*> InitialSightEntity;
184 typedef std::map<std::string, SightAction> PendingSightMap;
185 PendingSightMap m_pending;
194 std::deque<std::string> m_lookQueue;
196 unsigned int m_maxPendingCount;
198 typedef sigc::signal<void, Entity*> EntitySightSignal;
200 typedef std::map<std::string, EntitySightSignal> NotifySightMap;
201 NotifySightMap m_notifySights;
203 typedef std::set<Entity*> EntitySet;
209 class FactoryOrdering
212 bool operator()(Factory* a, Factory* b)
const
214 return a->priority() > b->priority();
218 typedef std::multiset<Factory*, FactoryOrdering> FactoryStore;
219 FactoryStore m_factories;
221 std::set<Task*> m_progressingTasks;
226 #endif // of ERIS_VIEW_H