diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-12-01 23:33:48 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-12-01 23:33:48 +0200 |
commit | af322405454191846507b91251d655c2b0aa864b (patch) | |
tree | 06213c35a56ecbf3ad6e8b509052e1ccd23cb783 /src/content_sao.h | |
parent | ee0d3bacbce612c1abc6016cb7b0d684df25b820 (diff) | |
download | minetest-af322405454191846507b91251d655c2b0aa864b.tar.gz minetest-af322405454191846507b91251d655c2b0aa864b.tar.bz2 minetest-af322405454191846507b91251d655c2b0aa864b.zip |
Players are more like objects + related stuff
Diffstat (limited to 'src/content_sao.h')
-rw-r--r-- | src/content_sao.h | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/src/content_sao.h b/src/content_sao.h index 19b0e74ba..51461bc95 100644 --- a/src/content_sao.h +++ b/src/content_sao.h @@ -50,7 +50,7 @@ public: std::string getClientInitializationData(); std::string getStaticData(); InventoryItem* createInventoryItem(); - void punch(ServerActiveObject *puncher); + void punch(ServerActiveObject *puncher, float time_from_last_punch); float getMinimumSavedMovement(){ return 0.1*BS; } private: std::string m_inventorystring; @@ -70,7 +70,7 @@ public: void step(float dtime, bool send_recommended); std::string getClientInitializationData(); std::string getStaticData(); - void punch(ServerActiveObject *puncher); + void punch(ServerActiveObject *puncher, float time_from_last_punch); private: bool m_is_active; IntervalLimiter m_inactive_interval; @@ -96,7 +96,7 @@ public: std::string getClientInitializationData(); std::string getStaticData(); InventoryItem* createPickedUpItem(){return NULL;} - void punch(ServerActiveObject *puncher); + void punch(ServerActiveObject *puncher, float time_from_last_punch); bool isPeaceful(){return false;} private: void doDamage(u16 d); @@ -156,7 +156,7 @@ public: std::string getClientInitializationData(); void step(float dtime, bool send_recommended); InventoryItem* createPickedUpItem(){return NULL;} - void punch(ServerActiveObject *puncher); + void punch(ServerActiveObject *puncher, float time_from_last_punch); bool isPeaceful(); private: void sendPosition(); @@ -210,7 +210,7 @@ public: std::string getClientInitializationData(); std::string getStaticData(); InventoryItem* createPickedUpItem(); - void punch(ServerActiveObject *puncher); + void punch(ServerActiveObject *puncher, float time_from_last_punch); void rightClick(ServerActiveObject *clicker); void setPos(v3f pos); void moveTo(v3f pos, bool continuous); @@ -240,30 +240,5 @@ private: float m_last_sent_move_precision; }; -class ServerRemotePlayer; - -class PlayerSAO : public ServerActiveObject -{ -public: - PlayerSAO(ServerEnvironment *env, v3f pos, - ServerRemotePlayer *player); - ~PlayerSAO(); - u8 getType() const - {return ACTIVEOBJECT_TYPE_PLAYER;} - void step(float dtime, bool send_recommended); - std::string getClientInitializationData(); - std::string getStaticData(); - bool isStaticAllowed() const - { return false; } - void punch(ServerActiveObject *puncher); - /* PlayerSAO-specific */ - void setPlayer(ServerRemotePlayer *player); - ServerRemotePlayer* getPlayer(); - void positionUpdated(); -private: - ServerRemotePlayer *m_player; - bool m_position_updated; -}; - #endif |