From fb5a98b72ab79949d1da7f75a3d6150c2906ef40 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Mon, 30 Aug 2021 14:48:06 +0200 Subject: gui: tech representation, menu, tile & unit info, attack info --- game/load.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'game/load.cpp') diff --git a/game/load.cpp b/game/load.cpp index d1a1722..5baae6c 100644 --- a/game/load.cpp +++ b/game/load.cpp @@ -41,6 +41,8 @@ void load_json (Gst &gst) { Tile tile; tile.name = it["name"]; tile.move_cost = it["move_cost"]; + tile.defence_bonus = it["defence_bonus"]; + tile.range_bonus = it["range_bonus"]; tile.spritebounds = vec2 { it["spritebounds"][0], it["spritebounds"][1] }; gst.tiles.push_back(tile); } @@ -88,4 +90,18 @@ void load_json (Gst &gst) { ent.spritebounds = vec2 { it["spritebounds"][0], it["spritebounds"][1] }; gst.infos.push_back(ent); } + + std::ifstream file_techs("content/techs.json"); + json j_techs; file_techs >> j_techs; + for (auto it : j_techs) { + Tech tech; + tech.name = it["name"]; + tech.id = it["id"]; + tech.level = it["level"]; + tech.req_id = it["req_id"]; + for (int i=0; i