37 #define MAPS_DIR "maps/" 100 return submap.size ();
109 return mapchar.size ();
354 string srcfile =
"");
385 vector <mapcharacter *> mapchar;
386 vector <mapobject *> mobj;
387 vector <string> mobjsrc;
388 vector <mapsquare_area *> submap;
Class to write data from a Gzip compressed file.
Declares the mapobject class.
Class to read data from a Gzip compressed file.
s_int8 delete_mapobject(u_int16 pos)
Delete a mapobject from a landmap.
#define u_int16
16 bits long unsigned integer
mapcharacter * get_mapcharacter(u_int16 pos)
Returns a pointer to a mapcharacter on this landmap.
s_int8 put_state(ogzstream &file) const
Saves the landmap's state into an opened file.
s_int8 put(ogzstream &file) const
Put a map into an opened file.
landmap()
Default constructor.
s_int8 insert_mapobject(mapobject *an, u_int16 pos, string srcfile="")
Adds a mapobject to a landmap.
u_int16 nbr_of_mapobjects() const
Get the number of mapobjects that the map owns.
mapsquare_area * get_submap(u_int16 pos)
Returns a pointer to a submap belonging to this landmap.
s_int8 insert_submap(u_int16 pos)
Inserts an empty landsubmap into the landmap.
Allows you to display a landmap on a specified area of a surface.
s_int8 save(string fname)
Save a map into a file.
s_int8 put_mapobject(u_int16 smap, u_int16 px, u_int16 py, u_int16 mobjnbr)
Put a mapobject on the map.
void update()
Update the entire map (mapcharacters, mapobjects, etc...
s_int8 load(string fname)
Load a map from a filename.
u_int16 nbr_of_mapcharacters() const
Get the number of mapcharacters that are on this map.
Map where the world takes place.
string filename() const
Get the filename of the map, i.e the file from which it has been loaded (if any). ...
Representation of characters on a landmap.
void remove_mapobject(u_int16 smap, u_int16 px, u_int16 py, u_int16 mobjnbr)
Remove a mapobject from the map.
Declares the mapcharacter class.
void clear()
Cleanup the map.
Base class for objects that want to register events.
s_int8 get_state(igzstream &file)
Restore the landmap's state from an opened file.
s_int8 delete_submap(u_int16 pos)
Remove a landsubmap from the landmap.
u_int16 nbr_of_submaps() const
Get the number of landsubmaps that the map owns.
#define s_int8
8 bits long signed integer
mapobject * get_mapobject(u_int16 pos)
Returns a pointer to a mapobject belonging to this landmap.
Objects that can be placed on a landmap.
Area of mapsquares, for use with landmap.