1 // Copyright (C) 2000, 2001, 2003 Michael Bartl
2 // Copyright (C) 2000, 2001, 2002, 2004, 2005 Ulf Lorenz
3 // Copyright (C) 2006 Andrea Paternesi
4 // Copyright (C) 2006, 2007, 2008 Ben Asselstine
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 3 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 Library General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 #include "UniquelyIdentified.h"
27 #include "LocationBox.h"
28 #include "rectangle.h"
32 class UniquelyIdentified;
34 //! A feature constructed on the game map.
36 * A Location is a map feature with a location, and a size.
37 * City, Ruin, Temple, Signpost and more classes are derived from Location.
39 class Location : public UniquelyIdentified, public LocationBox
42 //! Default constructor.
44 * @param pos The top-right corner of the feature is located at this
45 * position on the game map.
46 * @param size The number of tiles wide and high the feature is.
48 Location(Vector<int> pos, guint32 size = 1);
51 Location(const Location&);
53 //! Alternative copying constructor to change the position of the object.
54 Location(const Location&, Vector<int> pos);
56 //! Loading constructor.
58 * Load the location from an opened saved-game file.
60 * @param helper The opened saved-game file to read the location from.
61 * @param size The size of the feature. This value is not read in
62 * from the saved-game file.
64 Location(XML_Helper* helper, guint32 size = 1);