Mercurial > fife-parpg
comparison engine/core/model/structures/map.i @ 0:4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
author | mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sun, 29 Jun 2008 18:44:17 +0000 |
parents | |
children | 90005975cdbb |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4a0efb7baf70 |
---|---|
1 %module fife | |
2 %{ | |
3 #include "model/structures/map.h" | |
4 %} | |
5 | |
6 %include "std_list.i" | |
7 | |
8 %include "util/base/utilbase.i" | |
9 | |
10 namespace FIFE { | |
11 class Layer; | |
12 } | |
13 | |
14 namespace std { | |
15 %template(LayerList) list<FIFE::Layer*>; | |
16 } | |
17 | |
18 namespace FIFE { | |
19 | |
20 class Layer; | |
21 class Map; | |
22 | |
23 %feature("director") MapChangeListener; | |
24 class MapChangeListener { | |
25 public: | |
26 virtual ~MapChangeListener() {}; | |
27 virtual void onMapChanged(Map* map, std::vector<Layer*>& changedLayers) = 0; | |
28 virtual void onLayerCreate(Map* map, Layer* layer) = 0; | |
29 virtual void onLayerDelete(Map* map, Layer* layer) = 0; | |
30 }; | |
31 | |
32 class Map : public ResourceClass { | |
33 public: | |
34 | |
35 Map(const std::string& identifier, TimeProvider* tp_master=NULL); | |
36 ~Map(); | |
37 | |
38 const std::string& getId(); | |
39 | |
40 Layer* createLayer(const std::string& identifier, CellGrid* grid); | |
41 void deleteLayer(Layer* index); | |
42 | |
43 std::list<Layer*> getLayers() const; | |
44 Layer* getLayer(const std::string& id); | |
45 | |
46 size_t getNumLayers() const; | |
47 void deleteLayers(); | |
48 | |
49 void setTimeMultiplier(float multip); | |
50 double getTimeMultiplier() const; | |
51 | |
52 void addChangeListener(MapChangeListener* listener); | |
53 void removeChangeListener(MapChangeListener* listener); | |
54 bool isChanged(); | |
55 std::vector<Layer*>& getChangedLayers(); | |
56 }; | |
57 } |