From c298eb988874bc2cf3adb39c2532419ec76a24bc Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Thu, 2 Sep 2021 10:13:25 +0200 Subject: all imp sprites + train problems solved --- game/load.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'game/load.cpp') diff --git a/game/load.cpp b/game/load.cpp index c9c9132..16f0911 100644 --- a/game/load.cpp +++ b/game/load.cpp @@ -69,18 +69,18 @@ void load_json (Gst &gst) { for (auto blds : it["build"]) { ent.build.push_back(blds); } - for (auto train : it["train"]) { - ent.train.push_back(train); + for (auto train : it["train_id"]) { + ent.train_id.push_back(train); + } + for (auto train : it["train_class"]) { + ent.train_class.push_back((EntityInfo::Class) + EntityClass::from_string(train.get())); } for (auto ad : it["adjacent"]) { ent.adjacent.push_back(ad); } - std::string cl = it["class"]; - if (cl == "inf") ent.ent_class = EntityInfo::Class::inf; - if (cl == "cav") ent.ent_class = EntityInfo::Class::cav; - if (cl == "ran") ent.ent_class = EntityInfo::Class::ran; - if (cl == "sie") ent.ent_class = EntityInfo::Class::sie; - if (cl == "bld") ent.ent_class = EntityInfo::Class::bld; + ent.ent_class = (EntityInfo::Class) EntityClass::from_string( + it["class"].get()); for (auto ab : it["abilities"]) { int index = 0; for (int i=0; i())); } if (b.contains("aff_level")) { tech.bonus.aff_level = b["aff_level"]; -- cgit v1.2.3-54-g00ecf