From 411d2f6d6a6e5370d33f0f54b2f2de7147a9d977 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Mon, 6 Sep 2021 20:11:36 +0200 Subject: started ai --- game/gst.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'game/gst.h') diff --git a/game/gst.h b/game/gst.h index e86ddc5..376026e 100644 --- a/game/gst.h +++ b/game/gst.h @@ -68,11 +68,20 @@ class Gst { public: Gst(Inv *inv) : inv(inv) { } + // copy constructor + Gst (const Gst& rhs) { + inv = rhs.inv; entities = rhs.entities; players = rhs.players; + turn = rhs.turn; day = rhs.day; + } + Gst& operator=(const Gst& rhs) { + inv = rhs.inv; entities = rhs.entities; players = rhs.players; + turn = rhs.turn; day = rhs.day; + }; + Inv *inv; std::vector entities; std::vector players; - int turn { 0 }; int day { 0 }; @@ -97,6 +106,8 @@ class Gst { void heal (Entity &atk, Entity &def); void convert (Entity &atk, Entity &def); + int get_nearest_enemy (Entity &ent, int &mindist); + std::vector get_possible_trains (Entity &ent); std::vector get_possible_builds (Entity &ent); -- cgit v1.2.3-54-g00ecf