// // Created by koncord on 05.01.16. // #ifndef OPENMW_PLAYER_HPP #define OPENMW_PLAYER_HPP #include #include #include #include #include #include #include #include #include struct Player; typedef std::map TPlayers; typedef std::map TSlots; class Players { public: static void NewPlayer(RakNet::RakNetGUID id); static void DeletePlayer(RakNet::RakNetGUID id); static Player *GetPlayer(RakNet::RakNetGUID id); static Player *GetPlayer(unsigned short id); static TPlayers *GetPlayers(); private: static TPlayers players; static TSlots slots; }; class Player : public mwmp::BasePlayer { unsigned short id; public: enum { NOTLOADED=0, LOADED, POSTLOADED }; Player(RakNet::RakNetGUID id); unsigned short GetID(); void SetID(unsigned short id); bool isHandshaked(); void Handshake(); void Loaded(int state); int LoadedState(); void setLastAttackerID(unsigned short pid); void resetLastAttacker(); unsigned short getLastAttackerID(); virtual ~Player(); public: mwmp::Inventory inventorySendBuffer; private: bool handshake; int loaded; unsigned short lastAttacker; }; #endif //OPENMW_PLAYER_HPP