Move tile implementation to tile.cpp

This commit is contained in:
Jan Mrna
2025-09-27 14:34:52 +02:00
parent 33813c135f
commit e31a45b229
3 changed files with 11 additions and 9 deletions

View File

@@ -0,0 +1,8 @@
#include "tile.hpp"
const std::map<std::string_view, Tile> tile_types = {
{"Grass", {1.0, 0, 200, 0, 255}},
{"Mud", {2.0, 100, 100, 100, 255}},
{"Road", {0.5, 200, 200, 200, 255}},
{"Water", {10.0, 0, 50, 200, 255}},
};

View File

@@ -1,18 +1,12 @@
#pragma once
#include <cstdint>
#include <map>
#include <string_view>
#include <cstdint>
struct Tile {
float cost;
uint8_t R, G, B, A;
};
static const std::map<std::string_view, Tile> tile_types = {
{"Grass", {1.0, 0, 200, 0, 255}},
{"Mud", {2.0, 100, 100, 100, 255}},
{"Road", {0.5, 200, 200, 200, 255}},
{"Water", {10.0, 0, 50, 200, 255}},
};
extern const std::map<std::string_view, Tile> tile_types;