1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

RemotePlayer/LocalPlayer Player base class proper separation (code cleanup) (patch 3 of X)

* remove IGameDef from Player class, only LocalPlayer has it now
* move many attributes/functions only used by LocalPlayer from Player to LocalPlayer
* move many attributes/functions only used by RemotePlayer from Player to RemotePlayer
* make some functions const
* hudGetHotbarSelectedImage now returns const ref
* RemotePlayer getHotbarSelectedImage now returns const ref
* various code style fixes
This commit is contained in:
Loic Blot 2016-10-08 17:56:38 +02:00 committed by Ner'zhul
parent edba6e50d9
commit 7bbd716426
9 changed files with 255 additions and 292 deletions

View file

@ -317,7 +317,10 @@ public:
void hudSetHotbarImage(RemotePlayer *player, std::string name);
std::string hudGetHotbarImage(RemotePlayer *player);
void hudSetHotbarSelectedImage(RemotePlayer *player, std::string name);
std::string hudGetHotbarSelectedImage(RemotePlayer *player);
const std::string &hudGetHotbarSelectedImage(RemotePlayer *player) const
{
return player->getHotbarSelectedImage();
}
inline Address getPeerAddress(u16 peer_id)
{ return m_con.GetPeerAddress(peer_id); }