6decfc009d1d49b414e3d75a61d4c8965542297d
[lordsawar] / src / Location.h
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
5 //
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.
10 //
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.
15 //
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 
19 //  02110-1301, USA.
20 #ifndef LOCATION_H
21 #define LOCATION_H
22
23 #include "UniquelyIdentified.h"
24 #include <string>
25 #include "vector.h"
26 #include "stack.h"
27 #include "LocationBox.h"
28 #include "rectangle.h"
29
30 class Player;
31 class Location;
32 class UniquelyIdentified;
33
34 //! A feature constructed on the game map.
35 /** 
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.
38  */
39 class Location : public UniquelyIdentified, public LocationBox
40 {
41  public:
42      //! Default constructor.
43      /**
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.
47       */
48      Location(Vector<int> pos, guint32 size = 1);
49
50      //! Copy constructor.
51      Location(const Location&);
52
53      //! Alternative copying constructor to change the position of the object.
54      Location(const Location&, Vector<int> pos);
55
56      //! Loading constructor.
57      /**
58       * Load the location from an opened saved-game file.
59       *
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.
63       */
64      Location(XML_Helper* helper, guint32 size = 1);
65
66      //! Destructor.
67     ~Location();
68 };
69
70 #endif