- // Whether it can be cooked
- virtual bool isCookable() const {return false;}
- // Result of cooking (can randomize)
- virtual InventoryItem *createCookResult() const {return NULL;}
- // Time of cooking
- virtual float getCookTime() const {return 3.0;}
- // Whether it can be burned (<0 = cannot be burned)
- virtual float getBurnTime() const {return -1;}
-
- // Eat, press, activate, whatever.
- // Called when item is right-clicked when lying on ground.
- // If returns true, item shall be deleted.
- virtual bool use(ServerEnvironment *env,
- ServerActiveObject *user){return false;}
-
-protected:
- IGameDef *m_gamedef;
- u16 m_count;
-};
-
-class MaterialItem : public InventoryItem
-{
-public:
- MaterialItem(IGameDef *gamedef, content_t content, u16 count):
- InventoryItem(gamedef, count)
- {
- m_content = content;
- }
- /*
- Implementation interface
- */
- virtual const char* getName() const
- {
- return "MaterialItem";
- }
- virtual void serialize(std::ostream &os) const