diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2016-10-08 17:56:38 +0200 |
---|---|---|
committer | Ner'zhul <nerzhul@users.noreply.github.com> | 2016-10-08 22:27:44 +0200 |
commit | 7bbd716426bf989bf071e2322a9b797cc5f78acb (patch) | |
tree | 0c626a1cb5dd84a04c5963c020c0c9d29863e770 /src/server.h | |
parent | edba6e50d9c9c0a7120c251bed36a87b51f4c826 (diff) | |
download | minetest-7bbd716426bf989bf071e2322a9b797cc5f78acb.tar.gz minetest-7bbd716426bf989bf071e2322a9b797cc5f78acb.tar.bz2 minetest-7bbd716426bf989bf071e2322a9b797cc5f78acb.zip |
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
Diffstat (limited to 'src/server.h')
-rw-r--r-- | src/server.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server.h b/src/server.h index 8eb1afc9f..fc4758c5f 100644 --- a/src/server.h +++ b/src/server.h @@ -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); } |