]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/serverobject.h
Remove stuff made obsolete by making players more ActiveObject-like and raise protoco...
[dragonfireclient.git] / src / serverobject.h
index 4dac4686368fc8bf77bcd465ee795d5ac46d1681..1386136cebdb6a7551476727a17cfe73c55df533 100644 (file)
@@ -43,6 +43,7 @@ Some planning
 class ServerEnvironment;
 class InventoryItem;
 class Player;
+struct ToolDiggingProperties;
 
 class ServerActiveObject : public ActiveObject
 {
@@ -128,23 +129,24 @@ class ServerActiveObject : public ActiveObject
        virtual bool isStaticAllowed() const
        {return true;}
        
-       virtual void punch(ServerActiveObject *puncher){}
-       virtual void rightClick(ServerActiveObject *clicker){}
-       
-       // Returns a reference
-       virtual InventoryItem* getWieldedItem()
-               { return NULL; }
+       // time_from_last_punch is used for lessening damage if punching fast
+       virtual void punch(ServerActiveObject *puncher,
+                       float time_from_last_punch=1000000)
+       {}
+       virtual void rightClick(ServerActiveObject *clicker)
+       {}
+       virtual void getWieldDiggingProperties(ToolDiggingProperties *dst);
        virtual void damageWieldedItem(u16 amount)
-               {}
+       {}
        // If all fits, eats item and returns true. Otherwise returns false.
        virtual bool addToInventory(InventoryItem *item)
-               {return false;}
+       { return false; }
        virtual void addToInventoryLater(InventoryItem *item)
-               {}
+       {}
        virtual void setHP(s16 hp)
-               {}
+       {}
        virtual s16 getHP()
-               {return 0;}
+       { return 0; }
 
        /*
                Number of players which know about this object. Object won't be