Debian Codegraph @

engine/core/model/structures/location.i

raw
1 /***************************************************************************
2 * Copyright (C) 2005-2019 by the FIFE team *
3 * http://www.fifengine.net *
4 * This file is part of FIFE. *
5 * *
6 * FIFE is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2.1 of the License, or (at your option) any later version. *
10 * *
11 * This library 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 GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20 ***************************************************************************/
21
22 %module fife
23 %{
24 #include "model/structures/location.h"
25 %}
26
27 namespace FIFE {
28
29 class Map;
30 class Layer;
31 class NotSet;
32 class ModelCoordinate;
33 class ExactModelCoordinate;
34
35 // for some reason swig ignores operator= and gives warning. Ignore this for now
36 %ignore Location::operator=;
37
38 class Location {
39 public:
40 Location();
41 Location(const Location& loc);
42 Location(Layer* layer);
43 ~Location();
44 void reset();
45 Location& operator=(const Location& rhs) const;
46 inline bool operator==(const Location& loc) const;
47
48 Map* getMap() const;
49 void setLayer(Layer* layer);
50 Layer* getLayer() const;
51
52 void setExactLayerCoordinates(const ExactModelCoordinate& coordinates);
53 void setLayerCoordinates(const ModelCoordinate& coordinates);
54 void setMapCoordinates(const ExactModelCoordinate& coordinates);
55
56 ExactModelCoordinate& getExactLayerCoordinatesRef();
57 ExactModelCoordinate getExactLayerCoordinates() const;
58 ExactModelCoordinate getExactLayerCoordinates(const Layer* layer) const;
59
60 ModelCoordinate getLayerCoordinates() const;
61 ModelCoordinate getLayerCoordinates(const Layer* layer) const;
62
63 ExactModelCoordinate getMapCoordinates() const;
64
65 bool isValid() const;
66 double getCellOffsetDistance() const;
67
68 double getMapDistanceTo(const Location& location) const;
69 double getLayerDistanceTo(const Location& location) const;
70 };
71 std::ostream& operator<<(std::ostream& os, const Location& l);
72 }
73
74 namespace std {
75 %template(LocationVector) vector<FIFE::Location>;
76 }