From a7e84b60366c78b131d43157980fbe4c2df655e6 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 1 Nov 2024 16:03:53 +0100 Subject: small cleanup + checks --- frontend/GameData.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'frontend/GameData.cpp') diff --git a/frontend/GameData.cpp b/frontend/GameData.cpp index 4556621..e62cff1 100644 --- a/frontend/GameData.cpp +++ b/frontend/GameData.cpp @@ -41,8 +41,13 @@ Enemy * GameData::create_enemy(const string & name) { try { auto row = query.row(); - return EnemyFactory::create_enemy(row.col(0), row.col(1)); - // TODO: set all other properties + auto enemy = unique_ptr{ EnemyFactory::create_enemy(row.col(0), row.col(1)) }; + // TODO: min/max objects(?) + enemy->set_health(row.col(4)); + enemy->set_attack(static_cast(row.col(5)) / 100); + enemy->set_damage_min(row.col(6)); + enemy->set_damage_max(row.col(7)); + return enemy.release(); } catch (...) { return EnemyFactory::create_enemy(name.c_str()); } -- cgit v1.2.3