Introduced FileSystem and Out classes
[openstranded.git] / src / item.hh
blob46b283160d20e92d462419c0fa484f1ff70a4251
1 /*
2 * This file includes the definitions for the item specific classes
3 * derived from the Kingdom, Type and Entity base classes.
5 * Copyright (C) 2008 David Kolossa
7 * This file is part of OpenStranded
9 * OpenStranded is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * OpenStranded is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with OpenStranded. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef STRANDED_ITEM_HH
24 #define STRANDED_ITEM_HH
26 #include "kingdom.hh"
27 #include "type.hh"
28 #include "entity.hh"
30 #define S2_ITEM 3
32 /**
33 * This is the class of all entities which belong to the kingdom
34 * "item".
35 * An item is the only entity which can be collected by the player
36 * (without scripts) and which is stored in the inventory afterwards.
37 * An item can't move without the help of scripts.
39 class ItemEntity: public Entity
41 public:
42 /**
43 * The constructor.
44 * @param type The ID of the Type the item should belong to
46 ItemEntity (ID type);
50 /**
51 * This is the class of all item types derived from the Item base class.
53 class ItemType: public Type
55 public:
56 /**
57 * The constructor.
58 * @param name The name of the new item type
60 ItemType (const char* name);
64 /**
65 * The Item Kingdom class
67 class ItemKingdom: public Kingdom
69 public:
70 /**
71 * The constructor.
73 ItemKingdom ();
78 // Virtual methods
81 /**
82 * Create a new item entity
83 * @param type The ID of the type the new item should belong to
84 * @return A pointer to the new Entity
85 * @see ItemEntity::ItemEntity()
87 Entity*
88 createEntity (ID type);
90 /**
91 * Create a new item type
92 * @param name The name of the new type (visible in editor)
93 * @return A pointer to the new Type
94 * @see ItemType::ItemType()
96 Type*
97 createType (const char* name);
100 #endif /* STRANDED_ITEM_HH */