Support for cloning battles for AI purposes.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -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.") {
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user