From ace5c3f3093c50ff7fa6f8b281a377e3788abbd5 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Sun, 29 Aug 2021 13:57:41 +0200 Subject: adding techs --- game/entity.h | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'game/entity.h') diff --git a/game/entity.h b/game/entity.h index 1fcf026..36c8198 100644 --- a/game/entity.h +++ b/game/entity.h @@ -4,12 +4,10 @@ #include #include +#include + #include "../umath/vec2.h" -class Ability { - public: - Ability(); -}; class EntityInfo { public: @@ -17,25 +15,46 @@ class EntityInfo { std::string name; + int id; + float hp; float attack; float defence; int range; float sight; int move; - std::vector abilities; + int unit; + std::vector abilities; + std::vector build; + std::vector train; + + std::vector prod { 0, 0 }; + std::vector cost { 0, 0 }; + + std::vector adjacent; + + enum Class { inf, cav, ran, sie, bld }; + Class ent_class; vec2 spritebounds; }; class Entity { public: - Entity(int x, int y, EntityInfo &info, int owner) - : x(x), y(y), info(info), owner(owner) {} + Entity(int x, int y, EntityInfo *info, int owner) + : x(x), y(y), info(info), owner(owner) { moved = 0; hp = 100; } + + + bool operator==(Entity oth) { + return x == oth.x && y == oth.y && info->unit == oth.info->unit; + } + int building = 0; + float hp; /**/ int x, y; bool done = false; - EntityInfo &info; + int moved; + EntityInfo *info; int owner; }; -- cgit v1.2.3-54-g00ecf