![]() |
Deep RTS
|
#include <Tilemap.h>
Public Member Functions | |
| Tilemap (Map &map, Game &game) | |
| std::vector< Tile > & | getTiles () |
| Tile & | getSpawnTile (int playerID) |
| std::vector< Tile * > | neighbors (Tile &tile, Constants::Pathfinding type) |
| std::vector< Tile * > | getTileArea (Tile &source, uint32_t width, uint32_t height) |
| Tile & | getTile (uint32_t x, uint32_t y) |
| void | reset () |
| Reset the tilemap. More... | |
| bool | operator() (unsigned x, unsigned y) const |
Public Attributes | |
| Game & | game |
| Reference to the game object. More... | |
| std::vector< int > | spawnTiles |
| List of spawn tiles (Tiles that players can spawn on) More... | |
| std::vector< Tile > | tiles |
| List of all tiles in the tilemap. More... | |
The tilemap class specifies the map of the game This class is created from loading the map in the Map class
The constructor.
| map | A reference to the map object |
| game | A reference to the game |
| Tile & Tilemap::getSpawnTile | ( | int | playerID | ) |
Get the corresponding spawn tile for a specific player ID (each player is locked to a spawn position)
| playerID |
| Tile & Tilemap::getTile | ( | uint32_t | x, |
| uint32_t | y | ||
| ) |
Get a tile on position X and Y
| x | integer X position |
| y | integer Y position |
Get tiles in an area around a tile
| source | The source tile reference |
| width | Width of the area |
| height | Height of the area |
Get tiles based on width and height of unit
| std::vector< Tile > & Tilemap::getTiles | ( | ) |
Get all tiles in the tilemap
| std::vector< Tile * > Tilemap::neighbors | ( | Tile & | tile, |
| Constants::Pathfinding | type | ||
| ) |
Get a list of tiles that are neighbour to the input tile
| tile | The input tile reference |
| type | Which type of tiles you wish to retrieve |
| bool Tilemap::operator() | ( | unsigned | x, |
| unsigned | y | ||
| ) | const |
The implicit convertion is used in the JPS pathfinding. The call avaluates if the path is viable in a trajectory.
| x | |
| y |
| void Tilemap::reset | ( | ) |
Reset the tilemap.
| Game& Tilemap::game |
Reference to the game object.
| std::vector<int> Tilemap::spawnTiles |
List of spawn tiles (Tiles that players can spawn on)
| std::vector<Tile> Tilemap::tiles |
List of all tiles in the tilemap.