]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/inventory.h
Move ContentFeatures to mapnode_contentfeatures.{h,cpp} and clean stuff
[dragonfireclient.git] / src / inventory.h
index 3e05015efb6d7b9660be0f187427a49812867e3e..c202d5533125c860dbf15030c2da54840f592ec3 100644 (file)
@@ -29,7 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <string>
 #include "common_irrlicht.h"
 #include "debug.h"
-#include "mapblockobject.h"
 #include "main.h" // For g_materials
 #include "mapnode.h" // For content_t
 
@@ -37,7 +36,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 class ServerActiveObject;
 class ServerEnvironment;
-class Player;
 
 class InventoryItem
 {
@@ -118,7 +116,7 @@ class InventoryItem
        // Called when item is right-clicked when lying on ground.
        // If returns true, item shall be deleted.
        virtual bool use(ServerEnvironment *env,
-                       Player *player){return false;}
+                       ServerActiveObject *user){return false;}
 
 protected:
        u16 m_count;
@@ -153,10 +151,7 @@ class MaterialItem : public InventoryItem
                return new MaterialItem(m_content, m_count);
        }
 #ifndef SERVER
-       video::ITexture * getImage() const
-       {
-               return content_features(m_content).inventory_texture;
-       }
+       video::ITexture * getImage() const;
 #endif
        std::string getText()
        {
@@ -196,56 +191,6 @@ class MaterialItem : public InventoryItem
        content_t m_content;
 };
 
-//TODO: Remove
-class MapBlockObjectItem : public InventoryItem
-{
-public:
-       MapBlockObjectItem(std::string inventorystring):
-               InventoryItem(1)
-       {
-               m_inventorystring = inventorystring;
-       }
-       
-       /*
-               Implementation interface
-       */
-       virtual const char* getName() const
-       {
-               return "MBOItem";
-       }
-       virtual void serialize(std::ostream &os) const
-       {
-               std::string sane_string(m_inventorystring);
-               str_replace_char(sane_string, '|', '?');
-               os<<getName();
-               os<<" ";
-               os<<sane_string;
-               os<<"|";
-       }
-       virtual InventoryItem* clone()
-       {
-               return new MapBlockObjectItem(m_inventorystring);
-       }
-
-#ifndef SERVER
-       video::ITexture * getImage() const;
-#endif
-       std::string getText();
-
-       /*
-               Special methods
-       */
-       std::string getInventoryString()
-       {
-               return m_inventorystring;
-       }
-
-       MapBlockObject * createObject(v3f pos, f32 player_yaw, f32 player_pitch);
-
-private:
-       std::string m_inventorystring;
-};
-
 /*
        An item that is used as a mid-product when crafting.
        Subnames:
@@ -314,7 +259,7 @@ class CraftItem : public InventoryItem
        bool isCookable() const;
        InventoryItem *createCookResult() const;
 
-       bool use(ServerEnvironment *env, Player *player);
+       bool use(ServerEnvironment *env, ServerActiveObject *user);
        
        /*
                Special methods