4 * Purpose: common player state, usable on client and server
5 * Client: singleton representing the viewed player
6 * Server: instance per client, clients decoupled from players
8 CLASS(PlayerState, Object)
9 ATTRIB(PlayerState, m_client, entity);
10 CONSTRUCTOR(PlayerState, entity client)
12 CONSTRUCT(PlayerState);
13 this.m_client = client;
18 #define PS(this) ((this)._ps)
20 // TODO: renew on death
21 void PlayerState_attach(entity this);
22 void PlayerState_detach(entity this);
25 * Purpose: common client state, usable on client and server
26 * Client: singleton representing the viewed player
27 * Server: instance per client
29 CLASS(ClientState, Object)
30 ATTRIB(ClientState, m_client, entity);
31 CONSTRUCTOR(ClientState, entity client)
33 CONSTRUCT(ClientState);
34 this.m_client = client;
41 #define CS(this) (this._cs)
43 ClientState CS(Client this) { TC(Client, this); assert(this._cs); return this._cs; }
46 void ClientState_attach(entity this);
47 void ClientState_detach(entity this);