Compare commits

..
Author SHA1 Message Date
admin d1e96a47c6 Use direct vector declarations in AI score tests 2026-06-23 13:08:25 -07:00
13 changed files with 14 additions and 14 deletions
@@ -66,7 +66,7 @@ protected:
net::eagle0::shardok::storage::fb::DrawType_UNKNOWN_DRAW_TYPE);
endGameCondition.mutate_victory_details(
net::eagle0::shardok::storage::fb::VictoryCondition_UNKNOWN_VICTORY_CONDITION);
auto winningIdsVec = std::vector<PlayerId>{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
std::vector<PlayerId> winningIdsVec{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
auto winningIdsOff = fbb.CreateVector(winningIdsVec);
auto statusB = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
statusB.add_state(net::eagle0::shardok::storage::fb::GameStatus_::State_GAME_RUNNING);
@@ -75,7 +75,7 @@ protected:
net::eagle0::shardok::storage::fb::GameStatus_::State_GAME_RUNNING);
const auto mapOffset = AddHexMap(fbb, hexMap);
const auto attackerVC = vector<int8_t>{
const vector<int8_t> attackerVC{
net::eagle0::shardok::storage::fb::
VictoryCondition_VICTORY_CONDITION_LAST_PLAYER_STANDING,
net::eagle0::shardok::storage::fb::
@@ -87,7 +87,7 @@ protected:
1000,
&attackerVC);
const auto defenderVC = vector<int8_t>{
const vector<int8_t> defenderVC{
net::eagle0::shardok::storage::fb::
VictoryCondition_VICTORY_CONDITION_WIN_AFTER_MAX_ROUNDS,
net::eagle0::shardok::storage::fb::
@@ -33,7 +33,7 @@ protected:
defenderPlayer};
const auto playersOffset = fbb.CreateVectorOfSortedTables(&playersVec);
auto units = std::vector<Unit>{
std::vector<Unit> units{
AddGenericUnit(0, 0, attackerLocation),
AddGenericUnit(1, 1, defenderLocation)};
if (secondAttacker) { units.push_back(AddGenericUnit(0, 2, attacker2Location)); }
@@ -34,7 +34,7 @@ class ExtinguishFireCommandTests : public ::testing::Test {
fbb.ForceDefaults(true);
auto actorOff = AddGenericUnit(0, 0, Coords(3, 2));
vector<Unit> unitsVec{actorOff};
auto unitsVec = vector<Unit>{actorOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto mapOff = AddHexMap(fbb, BASIC_MAP_FB);
@@ -26,7 +26,7 @@ class FearCommandTest : public ::testing::Test {
auto actorOff = AddGenericUnit(5, 0, position);
auto victimOff = AddGenericUnit(4, 1, target);
vector<Unit> unitsVec{actorOff, victimOff};
auto unitsVec = vector<Unit>{actorOff, victimOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto mapOff = AddBasicMap(fbb);
@@ -19,7 +19,7 @@ class FortifyCommandTest : public ::testing::Test {
fbb.ForceDefaults(true);
auto engOff = AddGenericUnit(5, 0, Coords(2, 2));
vector<Unit> unitsVec{engOff};
auto unitsVec = vector<Unit>{engOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -35,7 +35,7 @@ class FreezeWaterCommandTest : public ::testing::Test {
auto undeadOff = AddGenericUndead(4, 1, target);
vector<Unit> unitsVec{mageOff, undeadOff};
auto unitsVec = vector<Unit>{mageOff, undeadOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -28,7 +28,7 @@ class HideCommandTests : public ::testing::Test {
auto rangerOff = AddGenericUnit(rangerPid, 0, position);
auto anotherOff = AddGenericUnit(anotherPid, 1, Coords(5, 5));
vector<Unit> unitsVec{rangerOff, anotherOff};
auto unitsVec = vector<Unit>{rangerOff, anotherOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -20,7 +20,7 @@ class MeteorCancelCommandTest : public ::testing::Test {
fbb.ForceDefaults(true);
auto casterOff = AddGenericUnit(5, 0, Coords(5, 5));
vector<Unit> unitsVec{casterOff};
auto unitsVec = vector<Unit>{casterOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -22,7 +22,7 @@ class MeteorStartCommandTest : public ::testing::Test {
fbb.ForceDefaults(true);
auto casterOff = AddGenericUnit(5, 0, Coords(5, 5));
vector<Unit> unitsVec{casterOff};
auto unitsVec = vector<Unit>{casterOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -23,7 +23,7 @@ class MeteorTargetCommandTest : public ::testing::Test {
auto casterOff = AddGenericUnit(5, 0, Coords(5, 5));
vector<Unit> unitsVec{casterOff};
auto unitsVec = vector<Unit>{casterOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -26,7 +26,7 @@ class RepairCommandTest : public ::testing::Test {
auto engOff = AddGenericUnit(1, 0, Coords(2, 2));
vector<Unit> unitsVec{engOff};
auto unitsVec = vector<Unit>{engOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto mapOff = AddBasicMap(fbb);
@@ -29,7 +29,7 @@ class StartFireCommandTests : public ::testing::Test {
fbb.ForceDefaults(true);
actor = AddGenericUnit(0, 0, Coords(2, 3));
std::vector<Unit> unitsVec{actor};
auto unitsVec = std::vector<Unit>{actor};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto hexMap = AddHexMap(fbb, BASIC_MAP_FB);