Move tool stuff to tool.{h,cpp}
[oweals/minetest.git] / src / player.h
index ce1001992fda971a02e2e565a7253f7a229d6978..e6dfb81991450569753ae626942243dac677e388 100644 (file)
@@ -150,7 +150,6 @@ public:
        bool in_water_stable;
        bool is_climbing;
        bool swimming_up;
-       bool is_frozen;
        
        u8 light;
 
@@ -180,11 +179,23 @@ public:
        Player on the server
 */
 
-class ServerRemotePlayer : public Player
+#include "serverobject.h"
+#include "content_object.h" // Object type IDs
+
+class ServerRemotePlayer : public Player, public ServerActiveObject
 {
 public:
-       ServerRemotePlayer()
+       ServerRemotePlayer():
+               ServerActiveObject(NULL, v3f(0,0,0))
+       {
+       }
+       ServerRemotePlayer(ServerEnvironment *env, v3f pos_, u16 peer_id_,
+                       const char *name_):
+               ServerActiveObject(env, pos_)
        {
+               setPosition(pos_);
+               peer_id = peer_id_;
+               updateName(name_);
        }
        virtual ~ServerRemotePlayer()
        {
@@ -199,6 +210,25 @@ public:
        {
        }
        
+       virtual void setPosition(const v3f &position)
+       {
+               Player::setPosition(position);
+               ServerActiveObject::setBasePosition(position);
+       }
+       
+       /* ServerActiveObject interface */
+
+       u8 getType() const
+               {return ACTIVEOBJECT_TYPE_PLAYER;}
+       virtual std::string getDescription(){return getName();}
+       // Returns a reference
+       virtual InventoryItem* getWieldedItem();
+       virtual void damageWieldedItem(u16 amount);
+       // If all fits, eats item and returns true. Otherwise returns false.
+       virtual bool addToInventory(InventoryItem *item);
+       virtual void setHP(s16 hp_);
+       virtual s16 getHP();
+
 private:
 };