1 // Copyright (C) 2008, Ben Asselstine
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 #ifndef MAP_BACKPACK_H
19 #define MAP_BACKPACK_H
23 #include "Immovable.h"
24 #include "UniquelyIdentified.h"
29 //! A backpack that resides on the map.
31 * A MapBackpack is an object that holds items, and has a position on the
35 class MapBackpack: public Backpack, public Immovable, public UniquelyIdentified
38 //! The xml tag of this object in a saved-game file.
39 static std::string d_tag;
41 //! Default constructor.
42 MapBackpack(Vector<int> pos);
45 MapBackpack(const MapBackpack&);
47 //! Loading constructor.
48 MapBackpack(XML_Helper* helper);
53 //! Save the MapBackpack object to an opened saved-game file.
54 bool save(XML_Helper* helper) const;
56 //! Return the plantable item that is planted here.
57 Item *getFirstPlantedItem();
59 //! Return the plantable item owned by player that is planted here.
60 Item *getPlantedItem(Player *player);