Support for cloning battles for AI purposes.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2021-04-11 15:20:50 +02:00
parent a3b7002cd4
commit 84a14cff2b
19 changed files with 236 additions and 30 deletions

View File

@@ -12,10 +12,11 @@ private:
ArbUt::StringView _name;
public:
explicit TestScript(const std::string& name) : _name(name.c_str(), name.length()){};
explicit TestScript(const ArbUt::StringView& name) : _name(name){};
const ArbUt::StringView& GetName() const noexcept override { return _name; }
void TestMethod(int& runCount) { runCount++; }
BattleScript* Clone() override { return new TestScript(_name); }
};
TEST_CASE("Script Aggregator properly iterates containing script.") {

View File

@@ -12,8 +12,10 @@ private:
ArbUt::StringView _name;
public:
explicit TestScript(const std::string& name) : _name(name.c_str(), name.length()){};
explicit TestScript(const ArbUt::StringView& name) : _name(name){};
const ArbUt::StringView& GetName() const noexcept override { return _name; }
BattleScript* Clone() override { return new TestScript(_name); }
};
TEST_CASE("Empty script set count == 0") {

View File

@@ -11,10 +11,11 @@ private:
ArbUt::StringView _name;
public:
explicit TestScript(const std::string& name) : _name(name.c_str(), name.length()){};
explicit TestScript(const ArbUt::StringView& name) : _name(name){};
const ArbUt::StringView& GetName() const noexcept override { return _name; }
void TestMethod(int& runCount) { runCount++; }
BattleScript* Clone() override { return new TestScript(_name); }
};
class ScriptSourceWithScriptPtr : public ScriptSource {