56 base_begin = tiles.end ();
63 mapchars = src.mapchars;
66 list <mapsquare_tile>::iterator it;
67 for (it = tiles.begin ();
68 it != tiles.end () && *(it->base_tile) < *it; it++);
79 list <mapsquare_char>::iterator i;
80 for (i = mapchars.begin (); i != mapchars.end (); i++)
88 list <mapsquare_char>::iterator i;
89 for (i = mapchars.begin (); i != mapchars.end (); i++)
112 list <mapsquare_tile>::iterator it;
136 for (it = area[px][py].tiles.begin ();
137 it != area[px][py].tiles.end () && *(it->base_tile) <= t; it++);
138 area[px][py].tiles.insert (it, t);
147 for (j = j0; j < je; j++)
148 for (i = i0; i < ie; i++)
156 if (i != px || j != py)
158 for (it = s.tiles.begin ();
159 it != s.tiles.end () &&
160 *(it->base_tile) <= *(t.base_tile); it++);
161 s.tiles.insert (it, t);
166 for (it = area[px][py].tiles.begin ();
167 it != area[px][py].tiles.end () && *(it->base_tile) < *it; it++);
168 area[px][py].base_begin = it;
176 list <mapsquare_tile>::iterator it;
188 for (it = area[px][py].tiles.begin (); it != area[px][py].tiles.end () &&
189 !(it->is_base ==
true && it->mapobj == mobj); it++);
192 if (it == area[px][py].tiles.end ())
return;
195 list <mapsquare_tile>::iterator the_base = it;
198 for (j = j0; j < je; j++)
199 for (i = i0; i < ie; i++)
201 if (i != px || j != py)
205 for (it = s.tiles.begin (); it != s.tiles.end () && it->base_tile != the_base; it++);
208 if (it == s.tiles.end ())
continue;
214 for (it = s.tiles.begin (); it != s.tiles.end (); it++)
216 u_int16 wx = it->x - (it->base_tile->x - it->mapobj->base_x ());
217 u_int16 wy = it->y - (it->base_tile->y - it->mapobj->base_y ());
219 it->mapobj->get_square (wx, wy)->get_walkable ());
225 s.tiles.erase (the_base);
228 for (it = s.tiles.begin (); it != s.tiles.end (); it++)
230 u_int16 wx = it->x - (it->base_tile->x - it->mapobj->base_x ());
231 u_int16 wy = it->y - (it->base_tile->y - it->mapobj->base_y ());
233 it->mapobj->get_square (wx, wy)->get_walkable ());
239 vector <vector<mapsquare> >::iterator i;
242 for (i = area.begin (); i != area.end (); i++)
246 for (j = 0; j < nl; j++)
247 for (k = 0; k < nh; k++)
Declares the mapobject class.
u_int16 area_height() const
Returns the height of the area.
~mapsquare_char()
Destructor.
bool is_free()
Returns whether the mapsquare is free for a character to go on or not.
#define u_int16
16 bits long unsigned integer
Contains informations about the position of an object on a map.
~mapsquare_area()
Destructor.
u_int16 area_length() const
Returns the length of the area.
u_int16 area_length() const
Returns the length of the area.
bool can_use_for_pathfinding
If == false, then this square will never be considered as walkable by pathfinding functions...
mapsquare()
Default constructor.
~mapsquare_tile()
Destructor.
mapcharacter * whoshere()
Return a pointer to the mapcharacter that occupies this mapsquare.
u_int8 get_walkable() const
Gets the raw walkable parameter of a mapsquare.
Contains information about the walkability of a mapsquare.
mapsquare_area()
Default constructor.
Base unit of a landsubmap, where you can place mapobjects or mapcharacters.
#define ALL_WALKABLE
Walkable from every side.
#define s_int16
16 bits long signed integer
void resize_area(u_int16 nl, u_int16 nh)
Resize the area.
void set_walkable(u_int8 w)
Sets the walkable parameter of a mapsquare.
mapsquare_walkable * get_square(u_int16 x, u_int16 y) const
Returns a pointer to a desired square.
u_int16 base_x() const
Returns the X offset of the base square of this object.
void clear()
Totally clears the area.
Representation of characters on a landmap.
Declares the mapsquare and mapsquare_area classes.
mapsquare_char()
Default constructor.
Declares the mapcharacter class.
u_int16 area_height() const
Returns the height of the area.
u_int16 base_y() const
Returns the Y offset of the base square of this object.
#define s_int8
8 bits long signed integer
mapsquare_tile()
Default constructor.
Objects that can be placed on a landmap.