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/entity.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'game/entity.h') diff --git a/game/entity.h b/game/entity.h index 50c7acc..8f61cee 100644 --- a/game/entity.h +++ b/game/entity.h @@ -13,6 +13,9 @@ class EntityInfo { public: EntityInfo() { spritebounds = vec2 { 16*6, 16 }; } + enum Class { inf, cav, ran, sie, bld }; + Class ent_class; + std::string name; int id; @@ -27,21 +30,23 @@ class EntityInfo { int unit; std::vector abilities; std::vector build; - std::vector train; + std::vector train_id; + std::vector train_class; std::vector prod { 0, 0 }; std::vector cost { 0, 0 }; std::vector adjacent; - + float defence_bonus { 0 }; int upgrade { -1 }; - enum Class { inf, cav, ran, sie, bld }; - Class ent_class; - vec2 spritebounds; }; +namespace EntityClass { + int from_string(std::string str); +} + class Entity { public: Entity(int x, int y, EntityInfo *info, int owner) @@ -58,6 +63,7 @@ class Entity { bool done = false; int moved; EntityInfo *info; + int fights { 0 }; int owner; }; -- cgit v1.2.3-54-g00ecf