Compare commits

..
Author SHA1 Message Date
admin d1e96a47c6 Use direct vector declarations in AI score tests 2026-06-23 13:08:25 -07:00
8 changed files with 9 additions and 9 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)); }
@@ -23,7 +23,7 @@ class EvacuatePrisonersCommandFactoryTest : public ::testing::Test {
auto actorOff = AddGenericUnit(0, 0, position);
auto enemyCaptiveOff = AddGenericUnit(1, 1, Coords(4, 4));
auto alliedCaptiveOff = AddGenericUnit(2, 2, Coords(5, 5));
std::vector<Unit> unitsVec{actorOff, enemyCaptiveOff, alliedCaptiveOff};
auto unitsVec = std::vector<Unit>{actorOff, enemyCaptiveOff, alliedCaptiveOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -16,7 +16,7 @@ class MoveCommandFactoryTest : public ::testing::Test {
auto actorOff = AddGenericUnit(1, 3, position);
auto enemyOff = AddGenericUnit(0, 2, Coords(3, 2));
vector<Unit> vec{actorOff, enemyOff};
auto vec = vector<Unit>{actorOff, enemyOff};
auto u = fbb.CreateVectorOfSortedStructs(&vec);
fbb.Finish(u);
@@ -44,7 +44,7 @@ class ReinforceCommandFactoryTest : public ::testing::Test {
auto defenderOffset = AddGenericUnit(1, 2, Coords(2, 5));
auto anotherReserveOffset = AddGenericUnit(2, 3, Coords(-1, -1));
std::vector<Unit> unitsVec{
auto unitsVec = std::vector<Unit>{
attacker1Offset,
reserveAttackerOffset,
defenderOffset,
@@ -29,7 +29,7 @@ class ScoutCommandFactoryTests : public ::testing::Test {
fbb.ForceDefaults(true);
auto rangerOff = AddGenericUnit(5, 0, position);
std::vector<Unit> unitsVec{rangerOff};
auto unitsVec = std::vector<Unit>{rangerOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto mapOff = AddBasicMap(fbb);
@@ -34,7 +34,7 @@ class StartFireCommandFactoryTest : public ::testing::Test {
auto friendlyOffset = AddGenericUnit(0, 1, Coords(5, 5));
auto defenderOffset = AddGenericUnit(1, 2, Coords(2, 0));
vector<Unit> unitsVec{attackerOffset, friendlyOffset, defenderOffset};
auto unitsVec = vector<Unit>{attackerOffset, friendlyOffset, defenderOffset};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
weather = WeatherFb();