Compare commits

..
Author SHA1 Message Date
admin 7b417eaac8 Use direct vector declarations in special command tests 2026-06-23 13:05:14 -07:00
7 changed files with 10 additions and 10 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);
std::vector<PlayerId> winningIdsVec{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
auto winningIdsVec = std::vector<PlayerId>{-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 vector<int8_t> attackerVC{
const auto attackerVC = vector<int8_t>{
net::eagle0::shardok::storage::fb::
VictoryCondition_VICTORY_CONDITION_LAST_PLAYER_STANDING,
net::eagle0::shardok::storage::fb::
@@ -87,7 +87,7 @@ protected:
1000,
&attackerVC);
const vector<int8_t> defenderVC{
const auto defenderVC = vector<int8_t>{
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);
std::vector<Unit> units{
auto units = std::vector<Unit>{
AddGenericUnit(0, 0, attackerLocation),
AddGenericUnit(1, 1, defenderLocation)};
if (secondAttacker) { units.push_back(AddGenericUnit(0, 2, attacker2Location)); }
@@ -23,7 +23,7 @@ class DismissUnitCommandTest : public ::testing::Test {
auto actorOff = AddGenericUnit(5, 0, Coords(1, 1));
auto undeadOff = AddGenericUndead(5, 1, Coords(3, 3));
auto unitsVec = vector<Unit>{actorOff, undeadOff};
vector<Unit> unitsVec{actorOff, undeadOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -29,7 +29,7 @@ class EndTurnCommandTest : public ::testing::Test {
auto otherOffset = AddGenericUnit(1, 1, Coords(1, 1));
auto unitsVec = std::vector<Unit>{casterOffset, otherOffset};
std::vector<Unit> unitsVec{casterOffset, otherOffset};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto hexMap = AddHexMap(fbb, BASIC_MAP_FB);
@@ -44,10 +44,10 @@ class EndTurnCommandTest : public ::testing::Test {
statusB.add_state(net::eagle0::shardok::storage::fb::GameStatus_::State_GAME_RUNNING);
auto statusOffset = statusB.Finish();
auto chargeesVec = std::vector<UnitId>(6, -1);
std::vector<UnitId> chargeesVec(6, -1);
auto chargeesOffset = fbb.CreateVector(chargeesVec);
auto pisVec = vector<flatbuffers::Offset<PlayerInfo>>{
vector<flatbuffers::Offset<PlayerInfo>> pisVec{
AddPlayerInfo(fbb, 0, false, 1000),
AddPlayerInfo(fbb, 1, true, 1000)};
auto pisOffset = fbb.CreateVector(pisVec);
@@ -21,7 +21,7 @@ class EvacuatePrisonersCommandTest : public ::testing::Test {
fbb.ForceDefaults(true);
auto actorOff = AddGenericUnit(0, 0, Coords(3, 3));
auto captiveOff = AddGenericUnit(1, 1, Coords(4, 4));
auto unitsVec = std::vector<Unit>{actorOff, captiveOff};
std::vector<Unit> unitsVec{actorOff, captiveOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -37,7 +37,7 @@ class ChallengeDuelCommandTests : public ::testing::Test {
auto defenderOff = AddGenericUnit(1, 0, Coords(0, 1));
auto challengerOff = AddGenericUnit(0, 1, Coords(0, 0));
auto units = std::vector<Unit>{defenderOff, challengerOff};
std::vector<Unit> units{defenderOff, challengerOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&units);
auto mapOffset = AddBasicMap(fbb);