|
|
|
@@ -51,7 +51,7 @@ TEST_F(UpdateGameStatusActionTests, onePlayerLeft_addsGameOverResult) {
|
|
|
|
|
|
|
|
|
|
auto coords = net::eagle0::shardok::storage::fb::Coords(3, 3);
|
|
|
|
|
auto onlyUnit = AddGenericUnit(0, 0, coords);
|
|
|
|
|
auto unitsVec = vector<Unit>{onlyUnit};
|
|
|
|
|
vector<Unit> unitsVec{onlyUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -96,7 +96,7 @@ TEST_F(UpdateGameStatusActionTests, twoPlayersLeft_noGameOverResult) {
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(2, 1);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -137,7 +137,7 @@ TEST_F(UpdateGameStatusActionTests, onePlayerAllUnitsHidden_gameOverResult) {
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(2, 1);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -183,7 +183,7 @@ TEST_F(UpdateGameStatusActionTests, remainingPlayerDoesNotHaveLastPlayerStanding
|
|
|
|
|
|
|
|
|
|
auto coords1 = net::eagle0::shardok::storage::fb::Coords(3, 3);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -232,7 +232,7 @@ TEST_F(UpdateGameStatusActionTests, attackerHoldsAllCastles_gameOverResult) {
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(0, 3);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -287,7 +287,7 @@ TEST_F(UpdateGameStatusActionTests, attackerHoldsAllCastles_hiddenDefenderFlees)
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto hiddenDefender = AddGenericUnit(1, 2, hiddenCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit, hiddenDefender};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit, hiddenDefender};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -349,7 +349,7 @@ TEST_F(UpdateGameStatusActionTests,
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto hiddenDefender = AddGenericUnit(1, 2, hiddenCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit, hiddenDefender};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit, hiddenDefender};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -406,7 +406,7 @@ TEST_F(UpdateGameStatusActionTests, attackerHoldsAllCastles_hiddenDefenderTooTir
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto hiddenDefender = AddGenericUnit(1, 2, hiddenCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit, hiddenDefender};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit, hiddenDefender};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -467,7 +467,7 @@ TEST_F(UpdateGameStatusActionTests, attackerHoldsAllCastles_notHiddenDefender_do
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto notHiddenDefender = AddGenericUnit(1, 2, hiddenCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit, notHiddenDefender};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit, notHiddenDefender};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -522,7 +522,7 @@ TEST_F(UpdateGameStatusActionTests, attackerHoldsAllCastles_notEndOfRound_noGame
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(0, 3);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -575,7 +575,7 @@ TEST_F(UpdateGameStatusActionTests,
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(0, 3);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -633,7 +633,7 @@ TEST_F(UpdateGameStatusActionTests, allianceVictory_alliesHaveConditionSet_retur
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(0, 3);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -695,7 +695,7 @@ TEST_F(UpdateGameStatusActionTests, allianceVictory_notAllAlliesHaveConditionSet
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(0, 3);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -758,7 +758,7 @@ TEST_F(UpdateGameStatusActionTests,
|
|
|
|
|
auto unit1 = AddGenericUnit(0, 0, castle1Coords);
|
|
|
|
|
auto unit2 = AddGenericUnit(1, 1, castle2Coords);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(2, 2, defenderCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{unit1, unit2, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{unit1, unit2, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -827,7 +827,7 @@ TEST_F(UpdateGameStatusActionTests, alliedCastleVictory_notMutuallyAllied_return
|
|
|
|
|
auto unit1 = AddGenericUnit(0, 0, castle1Coords);
|
|
|
|
|
auto unit2 = AddGenericUnit(1, 1, castle2Coords);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(2, 2, defenderCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{unit1, unit2, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{unit1, unit2, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -891,7 +891,7 @@ TEST_F(UpdateGameStatusActionTests, alliedCastleVictory_missingVictoryCondition_
|
|
|
|
|
auto unit1 = AddGenericUnit(0, 0, castle1Coords);
|
|
|
|
|
auto unit2 = AddGenericUnit(1, 1, castle2Coords);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(2, 2, defenderCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{unit1, unit2, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{unit1, unit2, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -953,7 +953,7 @@ TEST_F(UpdateGameStatusActionTests, alliedCastleVictory_emptyTile_returnsNoActio
|
|
|
|
|
auto defenderCoords = net::eagle0::shardok::storage::fb::Coords(2, 1);
|
|
|
|
|
auto unit1 = AddGenericUnit(0, 0, castle1Coords);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(2, 2, defenderCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{unit1, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{unit1, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -1012,7 +1012,7 @@ TEST_F(UpdateGameStatusActionTests, allianceVictory_notAllAllied_returnsNoAction
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(0, 3);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -1054,7 +1054,7 @@ TEST_F(UpdateGameStatusActionTests,
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(2, 1);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -1109,7 +1109,7 @@ TEST_F(UpdateGameStatusActionTests, maxRoundsExceeded_noWinAfterMaxRounds_throws
|
|
|
|
|
auto coords2 = net::eagle0::shardok::storage::fb::Coords(2, 1);
|
|
|
|
|
auto attackerUnit = AddGenericUnit(0, 0, coords1);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(1, 1, coords2);
|
|
|
|
|
auto unitsVec = vector<Unit>{attackerUnit, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{attackerUnit, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -1172,7 +1172,7 @@ TEST_F(UpdateGameStatusActionTests, attackerHoldsAllCastles_mutuallyAlliedCoAtta
|
|
|
|
|
auto unit1 = AddGenericUnit(0, 0, castleCoords);
|
|
|
|
|
auto unit2 = AddGenericUnit(1, 1, allyCoords);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(2, 2, defenderCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{unit1, unit2, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{unit1, unit2, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
@@ -1241,7 +1241,7 @@ TEST_F(UpdateGameStatusActionTests, attackerHoldsAllCastles_nonAlliedCoAttacker_
|
|
|
|
|
auto unit1 = AddGenericUnit(0, 0, castleCoords);
|
|
|
|
|
auto unit2 = AddGenericUnit(1, 1, allyCoords);
|
|
|
|
|
auto defenderUnit = AddGenericUnit(2, 2, defenderCoords);
|
|
|
|
|
auto unitsVec = vector<Unit>{unit1, unit2, defenderUnit};
|
|
|
|
|
vector<Unit> unitsVec{unit1, unit2, defenderUnit};
|
|
|
|
|
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
|
|
|
|
|
|
|
|
|
|
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
|
|
|
|
|