Classes | Functions | Variables

Loading Maps
[AESOP Map and Zone Interfaces]

To load a map, you must first register a MapFormatReader with the MapLoader. More...

Collaboration diagram for Loading Maps:

Classes

class  aesop::MapFormatReader
 MapFormatReader: these have to be implemented elsewhere, and then registered with the MapLoader below. More...

Functions

void aesop::destination_t::clear (void) throw ()
virtual const char * aesop::Map::getId (void) const =0 throw ()
virtual Zone * aesop::Map::getRootZone (void)=0 throw ()
virtual Zone * aesop::Map::getZone (IN const char *zone_id)=0
virtual void aesop::Map::iterateZones (IN zone_iteration_fn, IN void *context)=0
virtual const char * aesop::Map::getDefaultStartingPointId (void) const =0 throw ()
virtual void aesop::Map::getStartingPointIds (OUT VecString &ids) const =0
virtual void aesop::Map::getStartingPoint (IN const char *id, OUT destination_t &start) const =0
smart_ptr< Map > aesop::loadMap (IN const char *id, IN const char *path_to_map_file)
 This is the map loading routine clients should use.
virtual const char * aesop::MapFormatReader::getDescription (void)=0
virtual bool aesop::MapFormatReader::isMyFormat (IN const char *mapId, IN const char *path_to_map_file)=0
virtual smart_ptr< Map > aesop::MapFormatReader::loadMap (IN const char *mapId, IN const char *path_to_map_file)=0
void aesop::registerMapFormatReader (IN smart_ptr< MapFormatReader > &reader)
 This is how you can register a MapFormatReader with the map loader.

Variables

char aesop::destination_t::id [eAESOP_IdBufferSize]
 id of start point
rect3d_t aesop::destination_t::rect
 3D rect in zone

Detailed Description

To load a map, you must first register a MapFormatReader with the MapLoader.

Then you can ask the MapLoader to load a map, and it will work with the registered MapFormatReaders to make that happen.

See Reference Map/Zone Implemenation for a reference implementation. But any MapFormatReader that supports the aesop-map interfaces should work with all other components (server, client, etc.).

Why all this indirection? Precisely so that other server code (physics engines, AI, ...) can be kept insulated from map formats. It remains to be seen if that is actually practical!

Registration of map format readers is static. That is, once you register a map format reader, the entire process knows about it. For all known use cases, that is acceptable.

Order of registration matters! The first reader to claim a map is asked to load it.


Function Documentation

void aesop::destination_t::clear ( void   )  throw () [inline, inherited]

Definition at line 64 of file map.h.

virtual const char* aesop::Map::getId ( void   )  const throw () [pure virtual, inherited]
virtual Zone* aesop::Map::getRootZone ( void   )  throw () [pure virtual, inherited]
virtual Zone* aesop::Map::getZone ( IN const char *  zone_id  )  [pure virtual, inherited]
virtual void aesop::Map::iterateZones ( IN  zone_iteration_fn,
IN void *  context 
) [pure virtual, inherited]
virtual const char* aesop::Map::getDefaultStartingPointId ( void   )  const throw () [pure virtual, inherited]
virtual void aesop::Map::getStartingPointIds ( OUT VecString ids  )  const [pure virtual, inherited]
virtual void aesop::Map::getStartingPoint ( IN const char *  id,
OUT destination_t start 
) const [pure virtual, inherited]
smart_ptr<Map> aesop::loadMap ( IN const char *  id,
IN const char *  path_to_map_file 
)

This is the map loading routine clients should use.

It routes to the correct registered MapFormatReader, and notifies the given notification interface of any type IDs encountered.

virtual const char* aesop::MapFormatReader::getDescription ( void   )  [pure virtual, inherited]
virtual bool aesop::MapFormatReader::isMyFormat ( IN const char *  mapId,
IN const char *  path_to_map_file 
) [pure virtual, inherited]
virtual smart_ptr<Map> aesop::MapFormatReader::loadMap ( IN const char *  mapId,
IN const char *  path_to_map_file 
) [pure virtual, inherited]
void aesop::registerMapFormatReader ( IN smart_ptr< MapFormatReader > &  reader  ) 

This is how you can register a MapFormatReader with the map loader.


Variable Documentation

char aesop::destination_t::id[eAESOP_IdBufferSize] [inherited]

id of start point

Definition at line 70 of file map.h.

3D rect in zone

Definition at line 71 of file map.h.