mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 08:55:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
580828a97c |
@@ -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> {
|
||||
std::vector<AlliedPlayer> alliesVec;
|
||||
auto alliesVec = std::vector<AlliedPlayer>();
|
||||
alliesVec.reserve(piProto.allies_size());
|
||||
for (const auto& apProto : piProto.allies()) { alliesVec.emplace_back(apProto.player_id()); }
|
||||
const auto alliesOffset = fbb.CreateVectorOfStructs(alliesVec);
|
||||
|
||||
std::vector<int8_t> vcVec;
|
||||
auto vcVec = std::vector<int8_t>();
|
||||
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);
|
||||
|
||||
std::vector<Offset<PlayerInfo>> playerInfoVec;
|
||||
auto playerInfoVec = std::vector<Offset<PlayerInfo>>();
|
||||
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);
|
||||
|
||||
std::vector<Unit> unitsVec;
|
||||
auto unitsVec = std::vector<Unit>();
|
||||
unitsVec.reserve(units.size() + slackUnits);
|
||||
for (const auto& unit : units) {
|
||||
Unit modifiedUnit = unit;
|
||||
|
||||
@@ -23,7 +23,7 @@ class AIAttackGroupsTest : public ::testing::Test {
|
||||
flatbuffers::FlatBufferBuilder fbb;
|
||||
fbb.ForceDefaults(true);
|
||||
|
||||
auto unitsVec = std::vector<Unit>{
|
||||
std::vector<Unit> unitsVec{
|
||||
AddGenericUnit(0, 0, Coords(0, 0)),
|
||||
AddGenericUnit(0, 1, Coords(0, 1)),
|
||||
AddGenericUnit(0, 2, Coords(5, 0)),
|
||||
@@ -287,4 +287,4 @@ TEST_F(AIAttackGroupsTest, targetPriorities_assignHighestPowerFirst) {
|
||||
.target = Coords(0, 5),
|
||||
.attackLocations = upperRightAttackLocations}}),
|
||||
tpls[2].priorityOrder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class AIAttackerStrategySelectorTest : public ::testing::Test {
|
||||
flatbuffers::FlatBufferBuilder fbb;
|
||||
fbb.ForceDefaults(true);
|
||||
|
||||
auto unitsVec = std::vector<Unit>{
|
||||
std::vector<Unit> unitsVec{
|
||||
AddGenericUnit(0, 0, Coords(5, 0)),
|
||||
AddGenericUnit(0, 1, Coords(4, 0)),
|
||||
AddGenericUnit(0, 2, Coords(5, 5)),
|
||||
|
||||
@@ -21,7 +21,7 @@ class AIStrategySelectorTest : public ::testing::Test {
|
||||
flatbuffers::FlatBufferBuilder fbb;
|
||||
fbb.ForceDefaults(true);
|
||||
|
||||
auto unitsVec = std::vector<Unit>{
|
||||
std::vector<Unit> unitsVec{
|
||||
AddGenericUnit(0, 0, Coords(5, 0)),
|
||||
AddGenericUnit(0, 1, Coords(4, 0)),
|
||||
AddGenericUnit(0, 2, Coords(5, 5)),
|
||||
@@ -291,4 +291,4 @@ TEST_F(AIStrategySelectorTest,
|
||||
return GetGameSettings()->GetGetter().GetBattalionType(typeId);
|
||||
})
|
||||
.strategyType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class AIScoreUtilitiesTest : public ::testing::Test {
|
||||
flatbuffers::FlatBufferBuilder fbb;
|
||||
fbb.ForceDefaults(true);
|
||||
|
||||
auto unitsVec = std::vector<Unit>{
|
||||
std::vector<Unit> unitsVec{
|
||||
AddGenericUnit(0, 0, Coords(5, 0)),
|
||||
AddGenericUnit(0, 1, Coords(4, 0)),
|
||||
AddGenericUnit(0, 2, Coords(5, 5)),
|
||||
|
||||
@@ -26,7 +26,7 @@ class AIWaterCrossingCalculatorTest : public ::testing::Test {
|
||||
flatbuffers::FlatBufferBuilder fbb;
|
||||
fbb.ForceDefaults(true);
|
||||
|
||||
auto unitsVec = std::vector<Unit>{
|
||||
std::vector<Unit> unitsVec{
|
||||
AddGenericUnit(0, 0, Coords(5, 0)),
|
||||
AddGenericUnit(0, 1, Coords(4, 0))};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user