Map is way better and components::Tile is _vastly_ improved by switching to a wchar_t on display and letting nlohmann::json auto convert it for me.
This commit is contained in:
parent
2b57552152
commit
2e79cf8781
11 changed files with 70 additions and 71 deletions
|
@ -8,15 +8,6 @@
|
|||
using namespace fmt;
|
||||
using namespace components;
|
||||
|
||||
inline void check_player(DinkyECS::World &world, DinkyECS::Entity entity) {
|
||||
auto player = world.get_the<Player>();
|
||||
dbc::check(player.entity != entity, "player shouldn't be added to world");
|
||||
|
||||
auto tile = world.get<Tile>(player.entity);
|
||||
|
||||
// dbc::check(tile.chr == "\ua66b", format("PLAYER TILE CHANGED {} != {}", tile.chr, "\ua66b"));
|
||||
}
|
||||
|
||||
inline int make_split(Room &cur, bool horiz) {
|
||||
size_t dimension = horiz ? cur.height : cur.width;
|
||||
int min = dimension / WORLDBUILD_DIVISION;
|
||||
|
@ -238,8 +229,7 @@ void WorldBuilder::randomize_entities(DinkyECS::World &world, GameConfig &config
|
|||
auto entity_data = entity_db[key];
|
||||
|
||||
// pass that to the config as it'll be a generic json
|
||||
auto entity = configure_entity_in_map(world, entity_data, room_num);
|
||||
check_player(world, entity);
|
||||
configure_entity_in_map(world, entity_data, room_num);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -247,8 +237,7 @@ void WorldBuilder::place_stairs(DinkyECS::World& world, GameConfig& config) {
|
|||
auto& device_config = config.devices.json();
|
||||
auto entity_data = device_config["STAIRS_DOWN"];
|
||||
int last_room = $map.room_count() - 1;
|
||||
auto entity = configure_entity_in_map(world, entity_data, last_room);
|
||||
check_player(world, entity);
|
||||
configure_entity_in_map(world, entity_data, last_room);
|
||||
}
|
||||
|
||||
void WorldBuilder::place_entities(DinkyECS::World &world) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue