From 411d2f6d6a6e5370d33f0f54b2f2de7147a9d977 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Mon, 6 Sep 2021 20:11:36 +0200 Subject: started ai --- game/ai/tactic.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 game/ai/tactic.h (limited to 'game/ai/tactic.h') diff --git a/game/ai/tactic.h b/game/ai/tactic.h new file mode 100644 index 0000000..7eefef9 --- /dev/null +++ b/game/ai/tactic.h @@ -0,0 +1,32 @@ +#ifndef TACTIC_H +#define TACTIC_H + +#include +#include + +#include "action.h" + +namespace ai { + +class tactic { + public: + tactic () { } + + std::vector acts; + float eval = 0; + + // copy constructor + tactic (const tactic& rhs) { acts = rhs.acts; eval = rhs.eval; } + tactic& operator=(const tactic& rhs) { acts = rhs.acts; eval = rhs.eval; } + + std::string to_string () { + std::string str = "tactic eval= " + std::to_string(eval) + "\n"; + for (action act : acts) { + str += act.to_string() + "\n"; + } + return str; + } +}; + +} +#endif \ No newline at end of file -- cgit v1.2.3-54-g00ecf