aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/cpp/Map.cpp
blob: 6d3ee0110d03320600fc9257fe0e65d600567ddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "Map.hpp"

// TODO remove hardcoded values
Map::Map() : width(50), height(50)
{
    for (unsigned i = 0; i < width; i++) {
        for (unsigned j = 0; j < height; j++) {
            // TODO remove hardcoded values (grass)
            Tile tile(Tile::Type::GRASS, i, j); 
            _tiles.push_back(tile);
        }
    }
}

Tile& Map::tile(unsigned x, unsigned y)
{
    return _tiles[y * width + x];
}

const std::vector<Tile>& Map::tiles() const
{
    return _tiles;
}

bool Map::moveActor(Tile &from, Tile &to)
{
    // TODO
}