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

Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)

* Server/Client Environments now have an helper to cast Player object in the right type to use it
* Server: use RemotePlayer everywhere and remove previous added casts
* Client: use LocalPlayer where needed
* Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
This commit is contained in:
Loic Blot 2016-10-08 12:21:41 +02:00 committed by Ner'zhul
parent 9393e4a0a8
commit 656faf7373
12 changed files with 97 additions and 156 deletions

View file

@ -307,25 +307,26 @@ public:
Map & getMap() { return m_env->getMap(); }
ServerEnvironment & getEnv() { return *m_env; }
u32 hudAdd(Player *player, HudElement *element);
bool hudRemove(Player *player, u32 id);
bool hudChange(Player *player, u32 id, HudElementStat stat, void *value);
u32 hudAdd(RemotePlayer *player, HudElement *element);
bool hudRemove(RemotePlayer *player, u32 id);
bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value);
bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask);
bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount);
s32 hudGetHotbarItemcount(RemotePlayer *player) const
{ return player->getHotbarItemcount(); }
void hudSetHotbarImage(Player *player, std::string name);
std::string hudGetHotbarImage(Player *player);
void hudSetHotbarSelectedImage(Player *player, std::string name);
std::string hudGetHotbarSelectedImage(Player *player);
void hudSetHotbarImage(RemotePlayer *player, std::string name);
std::string hudGetHotbarImage(RemotePlayer *player);
void hudSetHotbarSelectedImage(RemotePlayer *player, std::string name);
std::string hudGetHotbarSelectedImage(RemotePlayer *player);
inline Address getPeerAddress(u16 peer_id)
{ return m_con.GetPeerAddress(peer_id); }
bool setLocalPlayerAnimations(Player *player, v2s32 animation_frames[4], f32 frame_speed);
bool setPlayerEyeOffset(Player *player, v3f first, v3f third);
bool setLocalPlayerAnimations(RemotePlayer *player, v2s32 animation_frames[4],
f32 frame_speed);
bool setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third);
bool setSky(Player *player, const video::SColor &bgcolor,
bool setSky(RemotePlayer *player, const video::SColor &bgcolor,
const std::string &type, const std::vector<std::string> &params);
bool overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness);