#include <environment.h>
Public Member Functions | |
| Environment (unsigned int width, unsigned int height, Layer *pBL, Kernel *kernel) | |
| unsigned int | getHeight () const |
| unsigned int | getWidth () const |
| void | displayAgent () |
| void | registerAgent (Agent *agent, int x, int y) |
| void | unregisterAgent (Agent *agent) |
| Agent * | getAgentAt (int x, int y) |
| bool | hasAgentAt (const Agent *agent, int x, int y) const |
| bool | moveAgent (Agent *agent, int x, int y) |
| const bool | findShortestPath (unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, std::vector< Destination > &rvdest) |
| Structure * | getBuildingXY (unsigned int x, unsigned int y) |
Static Public Member Functions | |
| static unsigned int | toSquareDistance (unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2) |
Private Types | |
|
typedef std::map< Agent *, AgentPosition >::iterator | m_last_pos_it |
|
typedef std::vector< Agent * >::iterator | m_vector_it |
|
typedef std::vector< Agent * >::const_iterator | m_vector_cit |
Private Attributes | |
| unsigned int | m_width |
| Width of the map. | |
| unsigned int | m_height |
| Height of the map. | |
| Kernel * | m_kernel |
| Layer * | m_pBuildingLayer |
| std::map< Agent *, AgentPosition > | m_last_pos |
| std::vector< Agent * > | m_vector |
Definition at line 62 of file environment.h.
|
||||||||||||||||||||
|
Create a new Environment instance with the specified width, and height.
Definition at line 99 of file environment.cpp. |
|
|
Display all the registered agents.
Definition at line 114 of file environment.cpp. References GraphicManager::DisplayAgent(), Kernel::getStep(), Agent::getX(), Agent::getY(), and GlobalVar::gpGraphicMgr. |
|
||||||||||||||||||||||||
|
Return the shortest path between 2 points. The length of the path is limited to MAX_PATH_LENGTH
Definition at line 211 of file environment.cpp. References PathFinder::findShortestPath(), and GlobalVar::gpPathFinder. |
|
||||||||||||||||||||
|
Calculate the square of the euclidian distance between 2 points
Definition at line 238 of file environment.cpp. |
1.4.2