#include <world.h>
Collaboration diagram for World:
Public Methods | |
World (string const &name, char color=0, unsigned h=100, unsigned w=100, int cPlayer=0) | |
~World () | |
vector< Tile > & | getMap () |
Player & | getCurrentPlayer () |
unsigned | getCurrentPlayerIndex () const |
int | getHeight () const |
int | getWidth () const |
unsigned | getNumPlayers () const |
int | getNumBuildings () const |
int | getTemperature () const |
Tile & | getTile (unsigned x, unsigned y) |
Tile & | getTileFromPixel (int x, int y) |
Returns the tile corresponding to the position (x,y) in world coordinates. More... | |
Player & | getPlayer (unsigned i) |
void | setTemperature (unsigned t) |
bool | parseMap (string &file) |
bool | playerExists (unsigned index) const |
void | addPlayer (const Player &p) |
void | addPlayer (unsigned id, string name, int race, char color) |
void | setCurrentPlayer (unsigned p) |
Sets the current (local) player for the game. More... | |
char * | resource2string (Resource r) |
Private Attributes | |
unsigned | currentPlayer |
unsigned | height |
unsigned | width |
int | temperature |
vector< Tile > | map |
vector< Player > | players |
vector< Tool > | tools |
vector< Building > | buildings |
Tile | nullTile |
|
Returns the tile corresponding to the position (x,y) in world coordinates. World coordinates are measured in pixel units (but this doesn'y mean that they are relative to the screen origin ;) ).
|
|
Sets the current (local) player for the game. Sets the current (local) player for the game to the one indicated in p. In case the indicated index exceeds the capacity of the players vector, it would expand it.
|