Deep RTS
Tilemap.h
Go to the documentation of this file.
1//
2// Created by Per-Arne on 24.02.2017.
3//
4#pragma once
5
6
7#include "Constants.h"
8#include "Tile.h"
9#include "Map.h"
10#include <vector>
11
12class Game;
13
16class Tilemap{
17
18public:
21
25 Tilemap(Map& map, Game &game);
26
28 std::vector<int> spawnTiles;
29
32 std::vector<Tile>& getTiles();
33
37 Tile &getSpawnTile(int playerID);
38
43 std::vector<Tile *> neighbors(Tile &tile, Constants::Pathfinding type);
44
50 std::vector<Tile *> getTileArea(Tile &source, uint32_t width, uint32_t height);
51
56 Tile &getTile(uint32_t x, uint32_t y);
57
59 std::vector<Tile> tiles;
60
62 void reset();
63
68 bool operator()(unsigned x, unsigned y) const;
69};
Definition: Game.h:23
Definition: Map.h:44
Definition: Tile.h:21
Definition: Tilemap.h:16
Tilemap(Map &map, Game &game)
Definition: Tilemap.cpp:8
std::vector< Tile > & getTiles()
Definition: Tilemap.cpp:79
Game & game
Reference to the game object.
Definition: Tilemap.h:20
std::vector< int > spawnTiles
List of spawn tiles (Tiles that players can spawn on)
Definition: Tilemap.h:28
Tile & getTile(uint32_t x, uint32_t y)
Definition: Tilemap.cpp:153
std::vector< Tile * > getTileArea(Tile &source, uint32_t width, uint32_t height)
Definition: Tilemap.cpp:159
Tile & getSpawnTile(int playerID)
Definition: Tilemap.cpp:200
std::vector< Tile * > neighbors(Tile &tile, Constants::Pathfinding type)
Definition: Tilemap.cpp:83
bool operator()(unsigned x, unsigned y) const
Definition: Tilemap.cpp:184
std::vector< Tile > tiles
List of all tiles in the tilemap.
Definition: Tilemap.h:59
void reset()
Reset the tilemap.
Definition: Tilemap.cpp:176
Pathfinding
Definition: Constants.h:76