Better handling of filling empty slots.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-12-07 12:13:12 +01:00
parent 345af31464
commit 57f16bc420
10 changed files with 80 additions and 31 deletions

View File

@@ -8,7 +8,7 @@
using namespace CreatureLib::Battling;
TEST_CASE("Set Choice one-sized side", "[Battling]") {
auto side = BattleSide(nullptr, 1);
auto side = BattleSide(0, nullptr, 1);
auto c = CreateCreature(GetLibrary(), "testSpecies1", 5).Create();
side.SetCreature(c, 0);
auto choice = new PassTurnChoice(c);
@@ -18,7 +18,7 @@ TEST_CASE("Set Choice one-sized side", "[Battling]") {
}
TEST_CASE("Set Choice one-sized side, validate all choices set", "[Battling]") {
auto side = BattleSide(nullptr, 1);
auto side = BattleSide(0, nullptr, 1);
auto c = CreateCreature(GetLibrary(), "testSpecies1", 5).Create();
side.SetCreature(c, 0);
auto choice = new PassTurnChoice(c);
@@ -30,7 +30,7 @@ TEST_CASE("Set Choice one-sized side, validate all choices set", "[Battling]") {
}
TEST_CASE("Set Choice two-sized side", "[Battling]") {
auto side = BattleSide(nullptr, 2);
auto side = BattleSide(0, nullptr, 2);
auto c1 = CreateCreature(GetLibrary(), "testSpecies1", 5).Create();
auto c2 = CreateCreature(GetLibrary(), "testSpecies1", 5).Create();
side.SetCreature(c1, 0);
@@ -46,7 +46,7 @@ TEST_CASE("Set Choice two-sized side", "[Battling]") {
}
TEST_CASE("Set Choice two-sized side, validate all choices set", "[Battling]") {
auto side = BattleSide(nullptr, 2);
auto side = BattleSide(0, nullptr, 2);
auto c1 = CreateCreature(GetLibrary(), "testSpecies1", 5).Create();
auto c2 = CreateCreature(GetLibrary(), "testSpecies1", 5).Create();
side.SetCreature(c1, 0);

View File

@@ -41,8 +41,8 @@ TEST_CASE("Use damaging move", "[Integrations]") {
auto battle = Battle(library, {battleParty1, battleParty2});
battle.SwitchCreature(0, 0, c1);
battle.SwitchCreature(1, 0, c2);
battle.FillEmptySlot(0, 0, c1);
battle.FillEmptySlot(1, 0, c2);
battle.TrySetChoice(new AttackTurnChoice(c1, c1->GetAttacks()[0], CreatureIndex(1, 0)));
battle.TrySetChoice(new PassTurnChoice(c2));