Basic tile map implemented.
This commit is contained in:
parent
290affa49a
commit
b66a3154c7
9 changed files with 135 additions and 12 deletions
33
tilemap.hpp
Normal file
33
tilemap.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <fmt/core.h>
|
||||
#include "point.hpp"
|
||||
#include "matrix.hpp"
|
||||
#include "config.hpp"
|
||||
|
||||
typedef std::vector<std::string> TileRow;
|
||||
typedef std::vector<TileRow> TileDisplay;
|
||||
|
||||
class TileMap {
|
||||
public:
|
||||
Config &$config;
|
||||
size_t $width;
|
||||
size_t $height;
|
||||
matrix::Matrix $tile_ids;
|
||||
TileDisplay $display;
|
||||
|
||||
TileMap(Config &config, size_t width, size_t height);
|
||||
|
||||
// disable copying
|
||||
TileMap(TileMap &map) = delete;
|
||||
|
||||
size_t width() { return $width; }
|
||||
size_t height() { return $height; }
|
||||
void load(matrix::Matrix &walls);
|
||||
|
||||
void dump(int show_x=-1, int show_y=-1);
|
||||
bool INVARIANT();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue