43 lines
954 B
C++
43 lines
954 B
C++
#ifndef OGLG_TERRAIN_H_
|
|
#define OGLG_TERRAIN_H_
|
|
|
|
#include "pc/Point.h"
|
|
#include "pc/pctypes.h"
|
|
#include "pc/commcode.h"
|
|
#include "logic/GameBoard.h"
|
|
#include <vector>
|
|
#include <exception>
|
|
|
|
class BadImportTerrainConfig:std::exception{
|
|
public:
|
|
BadImportTerrainConfig(size_t);
|
|
~BadImportTerrainConfig()=default;
|
|
const char* what() const noexcept;
|
|
private:
|
|
size_t pt;
|
|
};
|
|
|
|
class BadCapitalAssign:std::exception{
|
|
public:
|
|
~BadCapitalAssign()=default;
|
|
const char* what() const noexcept;
|
|
};
|
|
|
|
class ImportedTerrain{
|
|
public:
|
|
friend ImportedTerrain importTerrain(const ImportTerrainConfig &in);
|
|
GameBoard makeGameBoard(const InitInfo &init_info);
|
|
private:
|
|
struct TerrainTile{
|
|
TileType type;
|
|
std::int32_t unit;
|
|
};
|
|
pos_t w,h;
|
|
std::vector<std::vector<TerrainTile>> tiles;
|
|
std::vector<std::vector<std::vector<Point>>> capitals;
|
|
};
|
|
|
|
ImportedTerrain importTerrain(const ImportTerrainConfig &in);
|
|
|
|
#endif
|