52 base_begin = tiles.end ();
59 mapchars = src.mapchars;
62 list <mapsquare_tile>::iterator it;
63 for (it = tiles.begin ();
64 it != tiles.end () && *(it->base_tile) < *it; it++);
75 list <mapsquare_char>::iterator i;
76 for (i = mapchars.begin (); i != mapchars.end (); i++)
84 list <mapsquare_char>::iterator i;
85 for (i = mapchars.begin (); i != mapchars.end (); i++)
108 list <mapsquare_tile>::iterator it;
132 for (it = area[px][py].tiles.begin ();
133 it != area[px][py].tiles.end () && *(it->base_tile) <= t; it++);
134 area[px][py].tiles.insert (it, t);
143 for (j = j0; j < je; j++)
144 for (i = i0; i < ie; i++)
152 if (i != px || j != py)
154 for (it = s.tiles.begin ();
155 it != s.tiles.end () &&
156 *(it->base_tile) <= *(t.base_tile); it++);
157 s.tiles.insert (it, t);
162 for (it = area[px][py].tiles.begin ();
163 it != area[px][py].tiles.end () && *(it->base_tile) < *it; it++);
164 area[px][py].base_begin = it;
172 list <mapsquare_tile>::iterator it;
184 for (it = area[px][py].tiles.begin (); it != area[px][py].tiles.end () &&
185 !(it->is_base ==
true && it->mapobj == mobj); it++);
188 if (it == area[px][py].tiles.end ())
return;
191 list <mapsquare_tile>::iterator the_base = it;
194 for (j = j0; j < je; j++)
195 for (i = i0; i < ie; i++)
197 if (i != px || j != py)
201 for (it = s.tiles.begin (); it != s.tiles.end () && it->base_tile != the_base; it++);
204 if (it == s.tiles.end ())
continue;
210 for (it = s.tiles.begin (); it != s.tiles.end (); it++)
212 u_int16 wx = it->x - (it->base_tile->x - it->mapobj->base_x ());
213 u_int16 wy = it->y - (it->base_tile->y - it->mapobj->base_y ());
215 it->mapobj->get_square (wx, wy)->get_walkable ());
221 s.tiles.erase (the_base);
224 for (it = s.tiles.begin (); it != s.tiles.end (); it++)
226 u_int16 wx = it->x - (it->base_tile->x - it->mapobj->base_x ());
227 u_int16 wy = it->y - (it->base_tile->y - it->mapobj->base_y ());
229 it->mapobj->get_square (wx, wy)->get_walkable ());
235 vector <vector<mapsquare> >::iterator i;
238 for (i = area.begin (); i != area.end (); i++)
242 for (j = 0; j < nl; j++)
243 for (k = 0; k < nh; k++)
Declares the mapobject class.
~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
u_int16 area_height() const
Returns the height of the area.
Contains informations about the position of an object on a map.
mapsquare_walkable * get_square(u_int16 x, u_int16 y) const
Returns a pointer to a desired square.
~mapsquare_area()
Destructor.
u_int16 base_y() const
Returns the Y offset of the base square of this object.
bool can_use_for_pathfinding
If == false, then this square will never be considered as walkable by pathfinding functions...
u_int16 area_length() const
Returns the length of the area.
mapsquare()
Default constructor.
u_int8 get_walkable() const
Gets the raw walkable parameter of a mapsquare.
~mapsquare_tile()
Destructor.
mapcharacter * whoshere()
Return a pointer to the mapcharacter that occupies this mapsquare.
u_int16 area_length() const
Returns the length of the area.
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.
u_int16 base_x() const
Returns the X offset of the base square of this object.
#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.
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.
#define s_int8
8 bits long signed integer
mapsquare_tile()
Default constructor.
Objects that can be placed on a landmap.