#include <worldmap.h>
Collaboration diagram for DALT_Server::WorldMap:
Public Methods | |
WorldMap (map< int, Client *> *entity_dict) | |
~WorldMap () | |
int | getLocation (const vector< int > &coord) |
void | newMap (const vector< int > &axis) |
void | setCell (const vector< int > &coord, int value) |
void | clearCell (const vector< int > &coord) |
int | getCell (const vector< int > &coord) |
void | stateChange (Entity *from_state, Entity *to_state) |
void | parseMapFile (string file_name) |
Entity* | getEntityById (int id) throw (runtime_error) |
Public Attributes | |
vector<int> | axis |
list<Entity> | all_entities |
vector<Entity> | changed_entities |
vector<Entity> | to_be_removed |
Protected Attributes | |
int | dimensions |
vector<int> | the_map |
map<int, Client*>* | entity_dictionary |
As the world map is serialised into a vector, functions are provided to access the map by coordinates, no matter how many dimensions are used for the simulation. There are 2 views to the map.
|
constructor - initialises variabiles.
|
|
destructor; does nothing.
|
|
removes cell information (sets a map cell at given coordinates to 0).
|
|
gets the value of a cell at a specific location.
|
|
returns a pointer to an entity, given its id.
|
|
convert the coordinate based location to the linear format used to store the map.
|
|
creates a new map, given a set of dimension for each axis.
|
|
parse and load the map from a given file name.
|
|
set a map cell at given coordinates to a certain value.
|
|
used to signal a change of staty of an entity.
|
|
contains all entities currently present in the simulation.
|
|
the size of the world on each axis.
|
|
contains pointers to entities that have been changed in the last cycle.
|
|
number of dimensions used by the simulation.
|
|
client/agent map.
|
|
the map of the world, serialised into a vector.
|
|
entities that are queued for removal at the start of the next cycle.
|