Update to new Arbutils
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-06-26 17:08:23 +02:00
parent f50f76e993
commit 48639eeee5
44 changed files with 177 additions and 200 deletions

View File

@@ -9,11 +9,11 @@ using namespace CreatureLib::Battling;
class TestScript : public Script {
private:
ArbUt::CaseInsensitiveConstString _name;
ArbUt::StringView _name;
public:
explicit TestScript(std::string name) : _name(std::move(name)){};
const ArbUt::CaseInsensitiveConstString& GetName() const noexcept override { return _name; }
const ArbUt::StringView& GetName() const noexcept override { return _name; }
void TestMethod(int& runCount) { runCount++; }
};

View File

@@ -9,11 +9,11 @@ using namespace CreatureLib::Battling;
class TestScript : public Script {
private:
ArbUt::CaseInsensitiveConstString _name;
ArbUt::StringView _name;
public:
explicit TestScript(std::string name) : _name(std::move(name)){};
const ArbUt::CaseInsensitiveConstString& GetName() const noexcept override { return _name; }
const ArbUt::StringView& GetName() const noexcept override { return _name; }
};
TEST_CASE("Empty script set count == 0", "[Battling, Scripting]") {

View File

@@ -10,11 +10,11 @@ using namespace CreatureLib::Battling;
class TestScript : public Script {
private:
ArbUt::CaseInsensitiveConstString _name;
ArbUt::StringView _name;
public:
explicit TestScript(std::string name) : _name(std::move(name)){};
const ArbUt::CaseInsensitiveConstString& GetName() const noexcept override { return _name; }
const ArbUt::StringView& GetName() const noexcept override { return _name; }
void TestMethod(int& runCount) { runCount++; }
};

View File

@@ -232,23 +232,23 @@ TEST_CASE("Switch Creature in, mark as seen opponent for opponent", "[Integratio
auto seen = c3->GetSeenOpponents();
REQUIRE(seen.size() == 1);
REQUIRE(seen.find(c1) != seen.end());
REQUIRE(seen.contains(c1));
battle.TrySetChoice(new SwitchTurnChoice(c1, c2));
battle.TrySetChoice(new PassTurnChoice(c3));
seen = c3->GetSeenOpponents();
REQUIRE(seen.size() == 2);
REQUIRE(seen.find(c1) != seen.end());
REQUIRE(seen.find(c2) != seen.end());
REQUIRE(seen.contains(c1));
REQUIRE(seen.contains(c2));
battle.TrySetChoice(new SwitchTurnChoice(c2, c1));
battle.TrySetChoice(new PassTurnChoice(c3));
seen = c3->GetSeenOpponents();
REQUIRE(seen.size() == 2);
REQUIRE(seen.find(c1) != seen.end());
REQUIRE(seen.find(c2) != seen.end());
REQUIRE(seen.contains(c1));
REQUIRE(seen.contains(c2));
}
TEST_CASE("Flee Battle", "[Integrations]") {

View File

@@ -17,7 +17,7 @@ TEST_CASE("Int EffectParameter", "[Library]") {
}
TEST_CASE("String EffectParameter", "[Library]") {
auto p = EffectParameter((ArbUt::CaseInsensitiveConstString) "foobar"_cnc);
auto p = EffectParameter((ArbUt::StringView) "foobar"_cnc);
REQUIRE(p.AsString() == "foobar");
}