3 Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
4 Copyright (C) 2011 Kahrl <kahrl@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef CRAFTITEMDEF_HEADER
22 #define CRAFTITEMDEF_HEADER
24 #include "common_irrlicht.h"
28 struct CraftItemDefinition
30 std::string imagename;
31 std::string cookresult_item;
32 float furnace_cooktime;
33 float furnace_burntime;
35 bool liquids_pointable;
39 CraftItemDefinition();
41 void serialize(std::ostream &os);
42 void deSerialize(std::istream &is);
45 class ICraftItemDefManager
48 ICraftItemDefManager(){}
49 virtual ~ICraftItemDefManager(){}
50 virtual const CraftItemDefinition* getCraftItemDefinition(const std::string &itemname) const=0;
51 virtual std::string getImagename(const std::string &itemname) const =0;
53 virtual void serialize(std::ostream &os)=0;
56 class IWritableCraftItemDefManager : public ICraftItemDefManager
59 IWritableCraftItemDefManager(){}
60 virtual ~IWritableCraftItemDefManager(){}
61 virtual const CraftItemDefinition* getCraftItemDefinition(const std::string &itemname) const=0;
62 virtual std::string getImagename(const std::string &itemname) const =0;
64 virtual bool registerCraftItem(std::string itemname, const CraftItemDefinition &def)=0;
65 virtual void clear()=0;
67 virtual void serialize(std::ostream &os)=0;
68 virtual void deSerialize(std::istream &is)=0;
71 IWritableCraftItemDefManager* createCraftItemDefManager();