mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 02:48:40 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea3252db90 |
@@ -46,12 +46,12 @@ auto ConvertVictoryCondition(const net::eagle0::shardok::common::VictoryConditio
|
||||
|
||||
auto FromPlayerInfoProto(flatbuffers::FlatBufferBuilder& fbb, const PlayerInfoProto& piProto)
|
||||
-> flatbuffers::Offset<net::eagle0::shardok::storage::fb::PlayerInfo> {
|
||||
auto alliesVec = std::vector<AlliedPlayer>();
|
||||
std::vector<AlliedPlayer> alliesVec;
|
||||
alliesVec.reserve(piProto.allies_size());
|
||||
for (const auto& apProto : piProto.allies()) { alliesVec.emplace_back(apProto.player_id()); }
|
||||
const auto alliesOffset = fbb.CreateVectorOfStructs(alliesVec);
|
||||
|
||||
auto vcVec = std::vector<int8_t>();
|
||||
std::vector<int8_t> vcVec;
|
||||
const int victoryConditionCount = piProto.victory_conditions_size();
|
||||
vcVec.reserve(victoryConditionCount);
|
||||
for (int i = 0; i < victoryConditionCount; i++) {
|
||||
@@ -142,7 +142,7 @@ auto SetupInitialGameState(
|
||||
&endGameCondition);
|
||||
auto gameIdOffset = fbb.CreateString(gameId);
|
||||
|
||||
auto playerInfoVec = std::vector<Offset<PlayerInfo>>();
|
||||
std::vector<Offset<PlayerInfo>> playerInfoVec;
|
||||
playerInfoVec.reserve(playerInfoProtos.size());
|
||||
for (const auto& piProto : playerInfoProtos) {
|
||||
playerInfoVec.push_back(FromPlayerInfoProto(fbb, piProto));
|
||||
@@ -162,7 +162,7 @@ auto SetupInitialGameState(
|
||||
// Add slack units: 3 per necromancer, minimum 5 for general use
|
||||
const int slackUnits = std::max(5, necromancerCount * 3);
|
||||
|
||||
auto unitsVec = std::vector<Unit>();
|
||||
std::vector<Unit> unitsVec;
|
||||
unitsVec.reserve(units.size() + slackUnits);
|
||||
for (const auto& unit : units) {
|
||||
Unit modifiedUnit = unit;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user