diff options
Diffstat (limited to 'frontend/GameData.cpp')
-rw-r--r-- | frontend/GameData.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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<const char *>(0), row.col<const char *>(1)); - // TODO: set all other properties + auto enemy = unique_ptr<Enemy>{ EnemyFactory::create_enemy(row.col<const char *>(0), row.col<const char *>(1)) }; + // TODO: min/max objects(?) + enemy->set_health(row.col<int>(4)); + enemy->set_attack(static_cast<float>(row.col<int>(5)) / 100); + enemy->set_damage_min(row.col<int>(6)); + enemy->set_damage_max(row.col<int>(7)); + return enemy.release(); } catch (...) { return EnemyFactory::create_enemy(name.c_str()); } |