friend class VuSessionsIterator;
friend class VuSessionEntity;
public:
// constructors & destructor
VuGameEntity(ulong domainMask, char *gamename);
VuGameEntity(VU_BYTE **stream);
VuGameEntity(FILE *file);
virtual ~VuGameEntity();
// virtual function interface
virtual int SaveSize();
virtual int Save(VU_BYTE **stream);
virtual int Save(FILE *file);
// accessors
ulong DomainMask() { return domainMask_; }
char *GameName() { return gameName_; }
ushort MaxSessions() { return sessionMax_; }
int SessionCount() { return sessionCollection_->Count(); }
// setters
void SetGameName(char *groupname);
void SetMaxSessions(ushort max) { sessionMax_ = max; }
virtual VU_ERRCODE AddSession(VuSessionEntity *session);
virtual VU_ERRCODE RemoveSession(VuSessionEntity *session);
virtual VU_BOOL IsGame(); // returns TRUE
// event Handlers
#ifdef VU_LOW_WARNING_VERSION
virtual VU_ERRCODE Handle(VuErrorMessage *error);
virtual VU_ERRCODE Handle(VuPushRequest *msg);
virtual VU_ERRCODE Handle(VuPullRequest *msg);
virtual VU_ERRCODE Handle(VuEvent *event);
virtual VU_ERRCODE Handle(VuFullUpdateEvent *event);
virtual VU_ERRCODE Handle(VuPositionUpdateEvent *event);
virtual VU_ERRCODE Handle(VuEntityCollisionEvent *event);
virtual VU_ERRCODE Handle(VuTransferEvent *event);
virtual VU_ERRCODE Handle(VuSessionEvent *event);
#else
virtual VU_ERRCODE Handle(VuSessionEvent *event);
virtual VU_ERRCODE Handle(VuFullUpdateEvent *event);
#endif VU_LOW_WARNING_VERSION
protected:
VuGameEntity(int type, ulong domainMask, char *gamename, char
*groupname);
virtual VU_ERRCODE Distribute(VuSessionEntity *ent);
virtual VU_ERRCODE RemovalCallback();
private:
int LocalSize();
// returns local bytes written
// DATA
protected:
// shared data
ulong domainMask_;
char *gameName_;