00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef INCL_MAPPATCH
00026 #define INCL_MAPPATCH 1
00027
00028 #include <map>
00029 #include <list>
00030 #include "tiles.h"
00031
00032 class Game_object;
00033
00034
00035
00036
00037 class Object_spec
00038 {
00039 public:
00040 Tile_coord loc;
00041 int shapenum;
00042 int framenum;
00043 int quality;
00044 Object_spec(Tile_coord t, int shnum = c_any_shapenum,
00045 int frnum = c_any_framenum, int qual = c_any_qual)
00046 : loc(t), shapenum(shnum), framenum(frnum), quality(qual)
00047 { }
00048 };
00049
00050
00051
00052
00053 class Map_patch
00054 {
00055 Object_spec spec;
00056 public:
00057 friend class Map_patch_collection;
00058 Map_patch(Object_spec s) : spec(s)
00059 { }
00060 Game_object *find();
00061 virtual bool apply() = 0;
00062 };
00063
00064
00065 typedef std::list<Map_patch*> Map_patch_list;
00066 typedef std::map<int, Map_patch_list> Map_patch_map;
00067
00068
00069
00070
00071 class Map_patch_remove : public Map_patch
00072 {
00073 bool all;
00074 public:
00075 Map_patch_remove(Object_spec s, bool a = false) : Map_patch(s)
00076 { }
00077 virtual bool apply();
00078 };
00079
00080
00081
00082
00083 class Map_patch_modify : public Map_patch
00084 {
00085 Object_spec mod;
00086 public:
00087 Map_patch_modify(Object_spec s, Object_spec m) : Map_patch(s), mod(m)
00088 { }
00089 virtual bool apply();
00090 };
00091
00092
00093
00094
00095 class Map_patch_collection
00096 {
00097 Map_patch_map patches;
00098 public:
00099 Map_patch_collection()
00100 { }
00101 ~Map_patch_collection();
00102 void add(Map_patch *p);
00103 void apply(int schunk);
00104 };
00105
00106 #endif