Compare commits

...
Author SHA1 Message Date
admin db09df4576 Mark player utility results nodiscard 2026-06-23 17:39:24 -07:00
adminandGitHub 567846156c Mark action point distance helpers nodiscard (#8040)
* Mark action point distance helpers nodiscard

* Allow APD cache warmup calls
2026-06-23 17:27:06 -07:00
adminandGitHub 14f1ab992c Bake remaining iPad touch target sizes (#8007) 2026-06-23 17:23:17 -07:00
adminandGitHub 42cb9291fc Use inside for request battle test lookups (#8051) 2026-06-23 17:22:21 -07:00
adminandGitHub aa2bf97078 Use inside for tutorial test Options (#8050) 2026-06-23 17:22:07 -07:00
adminandGitHub 6976db961b Use inside for upgrade battalion quest Options (#8049) 2026-06-23 17:21:47 -07:00
adminandGitHub 1823543706 Use inside for alliance and army quest Options (#8048) 2026-06-23 17:21:31 -07:00
adminandGitHub c452b8be69 Use inside for recon quest result Options (#8047) 2026-06-23 17:21:13 -07:00
adminandGitHub 53612938b6 Mark victory score helpers nodiscard (#8046) 2026-06-23 17:20:57 -07:00
adminandGitHub ccb64480a8 Mark private AI score helpers nodiscard (#8045) 2026-06-23 17:20:44 -07:00
adminandGitHub 4f0a172036 Mark action result state helpers nodiscard (#8044) 2026-06-23 17:20:33 -07:00
adminandGitHub ca45eba76b Use inside for resolve battle claimant lookups (#8053) 2026-06-23 17:19:47 -07:00
adminandGitHub 8f58543a4c Use inside for action test Option lookups (#8052) 2026-06-23 17:18:55 -07:00
adminandGitHub 453242e06a Use inside for availability command Options (#8054) 2026-06-23 17:18:27 -07:00
adminandGitHub 249a564ac7 Use inside for combat availability Options (#8055) 2026-06-23 17:17:46 -07:00
adminandGitHub 701c822e1a Use inside for trade and recon availability Options (#8056) 2026-06-23 17:17:29 -07:00
adminandGitHub 2ca4b6e8d4 Mark game state guesser helpers nodiscard (#8043) 2026-06-23 16:20:50 -07:00
adminandGitHub fe060e4489 Mark AI planning helpers nodiscard (#8042) 2026-06-23 16:20:36 -07:00
adminandGitHub 6dc29ec746 Mark command factory helpers nodiscard (#8041) 2026-06-23 16:20:14 -07:00
adminandGitHub 8b9ac89205 Mark geometry weather helpers nodiscard (#8039) 2026-06-23 16:19:59 -07:00
adminandGitHub 74bbd490d7 Mark AI helper results nodiscard (#8038) 2026-06-23 16:19:45 -07:00
adminandGitHub 7a5f89ea87 Mark flatbuffer conversion helpers nodiscard (#8037) 2026-06-23 16:19:24 -07:00
adminandGitHub bdcddb88e4 Mark unit combat helpers nodiscard (#8036) 2026-06-23 16:19:08 -07:00
adminandGitHub cccc7971c1 Use inside for order and weather quest results (#8035) 2026-06-23 16:18:49 -07:00
adminandGitHub 82d2ca915d Mark map query helpers nodiscard (#8034) 2026-06-23 16:18:30 -07:00
adminandGitHub 319dc0b19e Use inside for quest chooser Option results (#8033) 2026-06-23 16:18:09 -07:00
adminandGitHub 2573f0f2af Initialize flatbuffer wrapper offsets (#8032) 2026-06-23 16:17:45 -07:00
adminandGitHub 641244103f Use nullopt default for tile modifiers (#8031) 2026-06-23 16:17:28 -07:00
adminandGitHub 1b7909d914 Simplify identity Option matches (#8030) 2026-06-23 16:17:15 -07:00
adminandGitHub 9d7dfd8f5f Mark remaining command accessors nodiscard (#8029) 2026-06-23 16:16:33 -07:00
adminandGitHub 42edef2313 Clean up simple collection idioms (#8028) 2026-06-23 16:16:16 -07:00
adminandGitHub 7ad6677b90 Mark more command accessors nodiscard (#8027) 2026-06-23 16:11:15 -07:00
adminandGitHub ce19c34b8b Clarify OAuth Try Either handling (#8026) 2026-06-23 16:06:17 -07:00
adminandGitHub d675e3781f Mark command accessors nodiscard (#8025) 2026-06-23 16:05:55 -07:00
adminandGitHub 2164a98abe Use Map.empty for empty map values (#8024) 2026-06-23 16:05:33 -07:00
adminandGitHub b61ce58f4c Use nullopt for absent optional values (#8023) 2026-06-23 16:01:55 -07:00
adminandGitHub 7a11c8fa9a Use nullopt in hex map utilities (#8022) 2026-06-23 16:01:41 -07:00
adminandGitHub 62438ec4f6 Use nullopt for empty optional returns (#8021) 2026-06-23 16:01:26 -07:00
adminandGitHub afcc6a9a3e Remove const from random generator return (#8020) 2026-06-23 16:00:48 -07:00
adminandGitHub b6a094064a Use braced empty ally pid return (#8019) 2026-06-23 16:00:30 -07:00
adminandGitHub 70b8eb6513 Default initialize hex map directions (#8018) 2026-06-23 16:00:16 -07:00
adminandGitHub e4c7a0c98b Clarify CoordsSet index arithmetic (#8017) 2026-06-23 16:00:02 -07:00
adminandGitHub 67573e7a8a Use braced ActionCost returns (#8016) 2026-06-23 15:59:43 -07:00
adminandGitHub c60dce4504 Default GameStateW special members (#8015) 2026-06-23 15:59:09 -07:00
adminandGitHub 8250d3d42f Use concatenated ai battle simulator namespace (#8013) 2026-06-23 15:58:47 -07:00
adminandGitHub 5407c8aa65 Use concatenated MCTS test namespace (#8012) 2026-06-23 15:58:34 -07:00
adminandGitHub d282634264 Use concatenated score helper namespace (#8011) 2026-06-23 15:58:19 -07:00
adminandGitHub fff0e6dd30 Use concatenated ai testing namespaces (#8010) 2026-06-23 15:58:06 -07:00
adminandGitHub a1ccdc672c Use Vector.empty for empty vector values (#8014) 2026-06-23 15:57:14 -07:00
adminandGitHub 6802da55ed Consolidate Shardok ranges algorithm cleanup (#8005) 2026-06-23 15:42:09 -07:00
215 changed files with 1765 additions and 1663 deletions
@@ -27,7 +27,7 @@ struct TargetAndAttackLocations {
Coords target;
CoordsSet attackLocations;
auto operator==(const TargetAndAttackLocations& rhs) const -> bool = default;
[[nodiscard]] auto operator==(const TargetAndAttackLocations& rhs) const -> bool = default;
};
struct TargetPriorityList {
@@ -39,7 +39,7 @@ struct TargetPriorityList {
priorityOrder(po) {}
};
auto EffectiveDistance(
[[nodiscard]] auto EffectiveDistance(
const Unit* unit,
const HexMap* map,
const AttackLocations& attackLocations,
@@ -47,7 +47,7 @@ auto EffectiveDistance(
const BattalionTypeGetter& battalionTypeGetter,
ActionPoints braveWaterCost) -> DIST_T;
auto EffectiveDistance(
[[nodiscard]] auto EffectiveDistance(
const Unit* unit,
const HexMap* map,
const CoordsSet& locations,
@@ -55,14 +55,14 @@ auto EffectiveDistance(
const BattalionTypeGetter& battalionTypeGetter,
ActionPoints braveWaterCost) -> DIST_T;
auto EffectiveDistance(
[[nodiscard]] auto EffectiveDistance(
const Unit* unit,
const ActionPointDistances* notBravingApd,
const ActionPointDistances* bravingApd,
const CoordsSet& locations) -> DIST_T;
// Chooses a list of targets in priority order for each unit.
auto GenerateTargetPriorities(
[[nodiscard]] auto GenerateTargetPriorities(
const std::vector<const Unit*>& occupants,
const HexMap* map,
const CoordsSet& targets,
@@ -104,13 +104,10 @@ auto DefenderDistanceBuf(
pointCostToDesiredTargetWithBraving);
}
std::sort(
begin(pointCosts),
end(pointCosts),
[](const WithoutAndWith &left, const WithoutAndWith &right) {
return left.without == right.without ? left.with < right.with
: left.without < right.without;
});
std::ranges::sort(pointCosts, [](const WithoutAndWith &left, const WithoutAndWith &right) {
return left.without == right.without ? left.with < right.with
: left.without < right.without;
});
// experiment: add dummy values to the end with very high cost, so there's never an advantage
// to leaving a defender unit alive in a castle.
@@ -13,7 +13,7 @@
namespace shardok {
auto DefenderDistanceBuf(
[[nodiscard]] auto DefenderDistanceBuf(
const Coords &defenderLocation,
const HexMap *hexMap,
const MapId &mapId,
@@ -12,7 +12,7 @@
namespace shardok {
inline auto CurrentAIExperimentId() -> int {
[[nodiscard]] inline auto CurrentAIExperimentId() -> int {
const char* rawValue = std::getenv("SHARDOK_SCORING_EXPERIMENT_ID");
if (rawValue == nullptr) { return 0; }
@@ -28,7 +28,9 @@ inline auto CurrentAIExperimentId() -> int {
return experimentId;
}
inline auto IsAIExperiment(const int id) -> bool { return CurrentAIExperimentId() == id; }
[[nodiscard]] inline auto IsAIExperiment(const int id) -> bool {
return CurrentAIExperimentId() == id;
}
} // namespace shardok
@@ -18,12 +18,12 @@ struct CoordsAndDistance {
int distance;
};
auto MinimumDistanceAndTarget(
[[nodiscard]] auto MinimumDistanceAndTarget(
const ActionPointDistances *apd,
const Coords &origin,
const CoordsSet &destinations) -> CoordsAndDistance;
auto MinimumDistance(
[[nodiscard]] auto MinimumDistance(
const ActionPointDistances *apd,
const Coords &origin,
const CoordsSet &destinations) -> int;
@@ -20,12 +20,12 @@ using GameState = net::eagle0::shardok::storage::fb::GameState;
using PlayerInfo = net::eagle0::shardok::storage::fb::PlayerInfo;
using Unit = net::eagle0::shardok::storage::fb::Unit;
auto HasAttachedHeroWithProfession(
[[nodiscard]] auto HasAttachedHeroWithProfession(
const Unit *unit,
net::eagle0::shardok::storage::fb::Profession profession) -> bool;
auto CastleClaimCapableAttackerUnitCount(const GameStateW &gameState) -> int;
auto PlayerInfoForPid(const GameStateW &, PlayerId pid) -> const PlayerInfo *;
[[nodiscard]] auto CastleClaimCapableAttackerUnitCount(const GameStateW &gameState) -> int;
[[nodiscard]] auto PlayerInfoForPid(const GameStateW &, PlayerId pid) -> const PlayerInfo *;
} // namespace shardok
@@ -26,11 +26,13 @@ struct AIStrategy {
};
extern AIStrategy FleeStrategy;
auto AttackUnitsStrategy(const vector<TargetPriorityList>& targetPriorities) -> AIStrategy;
auto AttackCastlesStrategy(const vector<TargetPriorityList>& targetPriorities) -> AIStrategy;
[[nodiscard]] auto AttackUnitsStrategy(const vector<TargetPriorityList>& targetPriorities)
-> AIStrategy;
[[nodiscard]] auto AttackCastlesStrategy(const vector<TargetPriorityList>& targetPriorities)
-> AIStrategy;
extern AIStrategy HoldCastlesStrategy;
extern AIStrategy ScatterStrategy;
auto CrossRiversStrategy(const CoordsSet& targetLocations) -> AIStrategy;
[[nodiscard]] auto CrossRiversStrategy(const CoordsSet& targetLocations) -> AIStrategy;
} // namespace shardok
@@ -30,7 +30,7 @@ public:
AIEvaluationCounter(AIEvaluationCounter&&) = delete;
auto operator=(AIEvaluationCounter&&) -> AIEvaluationCounter& = delete;
static int GetCurrentCount();
[[nodiscard]] static int GetCurrentCount();
};
// Configuration structure for iterative deepening time budget
@@ -44,7 +44,7 @@ struct AITimeBudget {
// Time budget is calculated dynamically based on number of available commands:
// budget = msPerCommand × numCommands (clamped to 200-5000ms)
// If isAllAiBattle is true, uses allAiBattleTimeBudgetMaximum instead of the normal maximum.
auto CalculateTimeBudget(
[[nodiscard]] auto CalculateTimeBudget(
PlayerId playerId,
const GameSettingsSPtr& settings,
const GameStateW& state,
@@ -17,9 +17,9 @@ using net::eagle0::shardok::storage::fb::Unit;
using ScoreValue = double;
class AttackLocations;
auto ContextFreeUnitValue(const Unit *unit) -> ScoreValue;
[[nodiscard]] auto ContextFreeUnitValue(const Unit *unit) -> ScoreValue;
auto GetRangedAttackBonus(
[[nodiscard]] auto GetRangedAttackBonus(
const Unit *unit,
bool isAttacker,
const HexMap *map,
@@ -32,7 +32,7 @@ auto GetRangedAttackBonus(
double minVigorToCast,
ActionPoints archeryActionPointCost = 0) -> double;
auto UnitValue(
[[nodiscard]] auto UnitValue(
const Unit *unit,
bool isAttacker,
const std::vector<const Unit *> &attackerUnits,
@@ -31,7 +31,7 @@ static inline void AssertValid(const Coords& c, const HexMap* hexMap) {
}
// Units that need a water crossing to reach at least one of the destinations
auto UnitIdsRequiringWaterCrossing(
[[nodiscard]] auto UnitIdsRequiringWaterCrossing(
const GameStateW& gameState,
PlayerId pid,
const CoordsSet& destinations,
@@ -39,14 +39,14 @@ auto UnitIdsRequiringWaterCrossing(
const BattalionTypeGetter& battalionTypeGetter) -> vector<UnitId>;
// Units belonging to the player that are capable of creating water crossings
auto UnitIdsToCreateWaterCrossing(
[[nodiscard]] auto UnitIdsToCreateWaterCrossing(
const GameStateW& gameState,
PlayerId pid,
const BattalionTypeGetter& battalionTypeGetter) -> vector<UnitId>;
// Whether a unit of the given type can reach destination from origin, given the current state
// of the map
auto CanReach(
[[nodiscard]] auto CanReach(
const Coords& origin,
const Coords& destination,
const HexMap* hexMap,
@@ -56,11 +56,12 @@ auto CanReach(
// Returns the *non*-water tiles from which you could bridge/freeze water to allow a unit to cross
// from origin to destination
auto CrossingStartLocations(const HexMap* hexMap, const CoordsSet& waterCrossingTiles) -> CoordsSet;
[[nodiscard]] auto CrossingStartLocations(const HexMap* hexMap, const CoordsSet& waterCrossingTiles)
-> CoordsSet;
// Returns the water tiles that, if they were bridged/frozen, would allow a unit to cross from
// origin to destination
auto WaterCrossingTiles(
[[nodiscard]] auto WaterCrossingTiles(
const Coords& origin,
const Coords& destination,
const HexMap* hexMap,
@@ -68,7 +69,7 @@ auto WaterCrossingTiles(
const BattalionTypeSPtr& battalionType) -> CoordsSet;
// Returns the set of tiles that the attacker should try to approach in order to bridge/freeze
auto IntendedCrossingStarts(
[[nodiscard]] auto IntendedCrossingStarts(
const GameStateW& gameState,
const vector<UnitId>& unitIdsCreatingCrossing,
const CoordsSet& tilesToStartCrossingFrom,
@@ -76,7 +77,7 @@ auto IntendedCrossingStarts(
const BattalionTypeGetter& battalionTypeGetter) -> CoordsSet;
// Calculate score based on water crossing strategy
auto WaterCrossingScore(
[[nodiscard]] auto WaterCrossingScore(
PlayerId playerId,
const BattalionTypeGetter& battalionTypeGetter,
const GameStateW& gameState,
@@ -23,7 +23,7 @@ using net::eagle0::shardok::storage::fb::PlayerInfo;
using ScoreValue = double;
auto AttackerHoldsCriticalTilesVictoryScore(
[[nodiscard]] auto AttackerHoldsCriticalTilesVictoryScore(
const GameStateW& gameState,
const CoordsSet& criticalTileLocations,
const PlayerInfo* player,
@@ -32,12 +32,12 @@ auto AttackerHoldsCriticalTilesVictoryScore(
const BattalionTypeGetter& battalionTypeGetter,
ActionPoints braveWaterCost) -> ScoreValue;
auto DefenderHoldsCriticalTilesVictoryScore(
[[nodiscard]] auto DefenderHoldsCriticalTilesVictoryScore(
const GameStateW& gameState,
const CoordsSet& criticalTileLocations,
const PlayerInfo* player) -> ScoreValue;
auto LastPlayerStandingVictoryScore(
[[nodiscard]] auto LastPlayerStandingVictoryScore(
const GameStateW& gameState,
const PlayerInfo* player,
const APDCache& apdCache,
@@ -7,8 +7,7 @@
#include "src/main/cpp/net/eagle0/shardok/ai/AIScoreUtilities.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/map/CoordsSet.hpp"
namespace shardok {
namespace score_calculator_internal {
namespace shardok::score_calculator_internal {
auto EffectiveDistanceCache::GetOrCompute(
const Unit* unit,
@@ -125,5 +124,4 @@ auto AttackerMultiplierForTargetDistance(
isLateGame);
}
} // namespace score_calculator_internal
} // namespace shardok
} // namespace shardok::score_calculator_internal
@@ -24,8 +24,7 @@
#include "src/main/flatbuffer/net/eagle0/shardok/storage/hex_map_generated.h"
#include "src/main/flatbuffer/net/eagle0/shardok/storage/unit_generated.h"
namespace shardok {
namespace score_calculator_internal {
namespace shardok::score_calculator_internal {
using HexMap = net::eagle0::shardok::storage::fb::HexMap;
using Unit = net::eagle0::shardok::storage::fb::Unit;
@@ -51,13 +50,13 @@ struct EffectiveDistanceCache {
struct CacheKey {
UnitId unitId;
Coords target;
bool operator==(const CacheKey& other) const {
[[nodiscard]] bool operator==(const CacheKey& other) const {
return unitId == other.unitId && target == other.target;
}
};
struct CacheKeyHash {
size_t operator()(const CacheKey& key) const {
[[nodiscard]] size_t operator()(const CacheKey& key) const {
return std::hash<UnitId>{}(key.unitId) ^ (std::hash<int>{}(key.target.row()) << 1) ^
(std::hash<int>{}(key.target.column()) << 2);
}
@@ -65,7 +64,7 @@ struct EffectiveDistanceCache {
mutable gtl::flat_hash_map<CacheKey, DIST_T, CacheKeyHash> cache;
DIST_T GetOrCompute(
[[nodiscard]] DIST_T GetOrCompute(
const Unit* unit,
const Coords& target,
const ActionPointDistances* notBravingApd,
@@ -75,11 +74,12 @@ struct EffectiveDistanceCache {
/// Calculate score for FLEE strategy
/// Returns negative score based on fleeing units
auto FleeStrategyScoreForState(const GameStateW& gameState, PlayerId playerId) -> ScoreValue;
[[nodiscard]] auto FleeStrategyScoreForState(const GameStateW& gameState, PlayerId playerId)
-> ScoreValue;
/// Calculate attacker multiplier based on distance to priority targets
/// This is used to weight attacker units by their proximity to objectives
auto AttackerMultiplierForTargetDistance(
[[nodiscard]] auto AttackerMultiplierForTargetDistance(
const Unit* attackingUnit,
const std::vector<TargetAndAttackLocations>& priorityList,
const std::vector<const Unit*>& occupants,
@@ -89,7 +89,6 @@ auto AttackerMultiplierForTargetDistance(
const ActionPointDistances* bravingApd,
bool isLateGame) -> double;
} // namespace score_calculator_internal
} // namespace shardok
} // namespace shardok::score_calculator_internal
#endif // EAGLE0_SHARDOK_AI_SCORE_PRIVATE_AI_SCORE_CALCULATOR_SHARED_UTILITIES_HPP
@@ -28,8 +28,7 @@
#include "src/main/protobuf/net/eagle0/shardok/common/player_info.pb.h"
#pragma clang diagnostic pop
namespace shardok {
namespace ai_battle_simulator {
namespace shardok::ai_battle_simulator {
namespace {
@@ -959,5 +958,4 @@ BattleResult AiBattleSimulator::CreateResultFromGameState(
return result;
}
} // namespace ai_battle_simulator
} // namespace shardok
} // namespace shardok::ai_battle_simulator
@@ -30,7 +30,9 @@ class ShardokEngine;
// Type alias for hex map
using HexMap = net::eagle0::shardok::storage::fb::HexMap;
namespace ai_battle_simulator {
} // namespace shardok
namespace shardok::ai_battle_simulator {
using BattleConfigProto = net::eagle0::shardok::ai_battle_simulator::BattleConfig;
@@ -146,7 +148,6 @@ private:
CreateResultFromGameState(const GameStateW& state, int totalRounds, int totalCommands) const;
};
} // namespace ai_battle_simulator
} // namespace shardok
} // namespace shardok::ai_battle_simulator
#endif // EAGLE0_SHARDOK_AI_BATTLE_SIMULATOR_AI_BATTLE_SIMULATOR_HPP
@@ -7,8 +7,7 @@
#include "src/main/cpp/net/eagle0/common/mcts/abstract/MCTSTypes.hpp"
#include "src/main/cpp/net/eagle0/shardok/ai/ShardokAIClient.hpp"
namespace shardok {
namespace ai_testing_common {
namespace shardok::ai_testing_common {
auto AIClientFactory::Create(
PlayerId playerId,
@@ -30,5 +29,4 @@ auto AIClientFactory::Create(
mctsConfig);
}
} // namespace ai_testing_common
} // namespace shardok
} // namespace shardok::ai_testing_common
@@ -8,8 +8,7 @@
#include "src/main/cpp/net/eagle0/shardok/library/ShardokEngine.hpp"
#include "src/main/flatbuffer/net/eagle0/shardok/storage/game_state.hpp"
namespace shardok {
namespace ai_testing_common {
namespace shardok::ai_testing_common {
auto GamePhaseRunner::RunSetupPhase(
ShardokEngine& engine,
@@ -58,5 +57,4 @@ auto GamePhaseRunner::RunSingleTurn(ShardokEngine& engine, PlayerId playerId, Sh
return true;
}
} // namespace ai_testing_common
} // namespace shardok
} // namespace shardok::ai_testing_common
@@ -9,8 +9,7 @@
#include "src/main/cpp/net/eagle0/common/byte_vector.hpp"
#include "src/main/cpp/net/eagle0/shardok/util/BattalionTypeRegistrar.hpp"
namespace shardok {
namespace ai_testing_common {
namespace shardok::ai_testing_common {
auto GameSettingsFactory::CreateDefault() -> GameSettingsSPtr {
auto settings = std::make_shared<GameSettings>();
@@ -31,5 +30,4 @@ auto GameSettingsFactory::CreateDefault() -> GameSettingsSPtr {
return settings;
}
} // namespace ai_testing_common
} // namespace shardok
} // namespace shardok::ai_testing_common
@@ -10,8 +10,7 @@
#include "src/main/cpp/net/eagle0/shardok/library/settings/GameSettings.hpp"
namespace shardok {
namespace ai_testing_common {
namespace shardok::ai_testing_common {
/**
* Factory class for creating GameSettings instances with standard configuration.
@@ -33,7 +32,6 @@ public:
static auto CreateDefault() -> GameSettingsSPtr;
};
} // namespace ai_testing_common
} // namespace shardok
} // namespace shardok::ai_testing_common
#endif // EAGLE0_SHARDOK_AI_TESTING_COMMON_GAME_SETTINGS_FACTORY_HPP
@@ -32,9 +32,8 @@ private:
static auto CannotBecomeOutlaw(const GameStateW &gameState, PlayerId pid) -> bool {
if (pid == UNCONTROLLED_PLAYER_ID) return false;
const auto &player = std::find_if(
std::begin(*gameState->player_infos()),
std::end(*gameState->player_infos()),
const auto &player = std::ranges::find_if(
*gameState->player_infos(),
[pid](const PlayerInfoFb *pi) { return pi->player_id() == pid; });
return (player != std::end(*gameState->player_infos()) && player->cannot_become_outlaw());
@@ -43,9 +42,8 @@ private:
static auto IsAttacker(const GameStateW &gameState, PlayerId pid) -> bool {
if (pid == UNCONTROLLED_PLAYER_ID) return false;
const auto &player = std::find_if(
std::begin(*gameState->player_infos()),
std::end(*gameState->player_infos()),
const auto &player = std::ranges::find_if(
*gameState->player_infos(),
[pid](const PlayerInfoFb *pi) { return pi->player_id() == pid; });
return (player == std::end(*gameState->player_infos()) || !player->is_defender());
@@ -189,12 +189,12 @@ struct BattalionType {
}
[[nodiscard]] auto GetCostToEnterTerrain(const TerrainProto &terrain) const -> ActionCost {
if (HasBridge(terrain.modifier()))
return ActionCost(
ActionCost::standard,
if (HasBridge(terrain.modifier())) {
return {ActionCost::standard,
ActionPoints(std::ceil(
100.0 * minimumCostToEnterBridge /
terrain.modifier().bridge().integrity().value())));
terrain.modifier().bridge().integrity().value()))};
}
if (IsFrozen(terrain.modifier())) return costToEnterIce;
auto terrainCost = GetCostToEnterTerrainType(terrain.type());
@@ -208,11 +208,11 @@ struct BattalionType {
[[nodiscard]] auto GetCostToEnterTerrain(
const net::eagle0::shardok::storage::fb::Terrain_::Type terrainType,
const net::eagle0::shardok::storage::fb::TileModifier &tm) const -> ActionCost {
if (tm.bridge().present())
return ActionCost(
ActionCost::standard,
if (tm.bridge().present()) {
return {ActionCost::standard,
ActionPoints(
std::ceil(100.0 * minimumCostToEnterBridge / tm.bridge().integrity())));
std::ceil(100.0 * minimumCostToEnterBridge / tm.bridge().integrity()))};
}
if (tm.ice().present()) return costToEnterIce;
auto terrainCost = GetCostToEnterTerrainType(terrainType);
@@ -44,7 +44,7 @@ inline constexpr DamageType DamageType_aessence = DamageType::DamageType_aessenc
inline constexpr DamageType DamageType_impact = DamageType::DamageType_impact;
inline constexpr int NUM_DAMAGE_TYPES = static_cast<int>(DamageType::NUM_DAMAGE_TYPES);
static inline bool DamageTypeGetsTerrainDefense(const DamageType type) {
[[nodiscard]] static inline bool DamageTypeGetsTerrainDefense(const DamageType type) {
switch (type) {
case DamageType_slashing:
case DamageType_puncturing:
@@ -132,11 +132,13 @@ public:
return damageByType.at(PenetratingIndex(type));
};
bool operator==(const CombatDamage& cmpr) const { return damageByType == cmpr.damageByType; }
[[nodiscard]] bool operator==(const CombatDamage& cmpr) const {
return damageByType == cmpr.damageByType;
}
bool operator!=(const CombatDamage& cmpr) const { return !(*this == cmpr); }
[[nodiscard]] bool operator!=(const CombatDamage& cmpr) const { return !(*this == cmpr); }
bool operator<=(const CombatDamage& cmpr) const {
[[nodiscard]] bool operator<=(const CombatDamage& cmpr) const {
return std::ranges::equal(
damageByType,
cmpr.damageByType,
@@ -145,7 +147,7 @@ public:
});
}
bool operator>=(const CombatDamage& cmpr) const {
[[nodiscard]] bool operator>=(const CombatDamage& cmpr) const {
return std::ranges::equal(
damageByType,
cmpr.damageByType,
@@ -154,11 +156,15 @@ public:
});
}
bool operator>(const CombatDamage& cmpr) const { return ((*this >= cmpr) && !(*this == cmpr)); }
[[nodiscard]] bool operator>(const CombatDamage& cmpr) const {
return ((*this >= cmpr) && !(*this == cmpr));
}
bool operator<(const CombatDamage& cmpr) const { return ((*this <= cmpr) && !(*this == cmpr)); }
[[nodiscard]] bool operator<(const CombatDamage& cmpr) const {
return ((*this <= cmpr) && !(*this == cmpr));
}
CombatDamage operator+(const CombatDamage& add) const {
[[nodiscard]] CombatDamage operator+(const CombatDamage& add) const {
return Builder()
.SetSlashing(
GetNormalDamageOfType(DamageType_slashing) +
@@ -219,7 +225,7 @@ public:
.Build();
}
CombatDamage operator*(const double factor) const {
[[nodiscard]] CombatDamage operator*(const double factor) const {
return Builder()
.SetSlashing(GetNormalDamageOfType(DamageType_slashing) * factor)
.SetPuncturing(GetNormalDamageOfType(DamageType_puncturing) * factor)
@@ -451,7 +457,9 @@ public:
}
};
inline CombatDamage operator*(const double factor, const CombatDamage& dmg) { return dmg * factor; }
[[nodiscard]] inline CombatDamage operator*(const double factor, const CombatDamage& dmg) {
return dmg * factor;
}
} // namespace shardok
#endif // EAGLE0_SHARDOK_LIBRARY_COMBAT_DAMAGE_HPP
@@ -21,19 +21,23 @@ using WeatherFb = net::eagle0::shardok::storage::fb::Weather;
using TerrainProto = net::eagle0::shardok::common::Terrain;
using Terrain = net::eagle0::shardok::storage::fb::Terrain;
auto PropensityByTerrain(const Terrain *terrain, const SettingsGetter &settings) -> int;
[[nodiscard]] auto PropensityByTerrain(const Terrain *terrain, const SettingsGetter &settings)
-> int;
auto PropensityByTerrain(const TerrainProto &terrain, const SettingsGetter &settings) -> int;
[[nodiscard]] auto PropensityByTerrain(const TerrainProto &terrain, const SettingsGetter &settings)
-> int;
auto PropensityByTerrain(
[[nodiscard]] auto PropensityByTerrain(
const TerrainType &terrainType,
const TileModifierProto &modifier,
const SettingsGetter &settings) -> int;
auto GetFireDamage(int troops, double openEndedPercentileRoll1, double openEndedPercentileRoll2)
-> CombatDamage;
[[nodiscard]] auto GetFireDamage(
int troops,
double openEndedPercentileRoll1,
double openEndedPercentileRoll2) -> CombatDamage;
auto GetExtinguishOdds(
[[nodiscard]] auto GetExtinguishOdds(
const SettingsGetter &settings,
const Terrain *terrain,
const WeatherFb *currentWeather,
@@ -41,7 +45,7 @@ auto GetExtinguishOdds(
double intelligence,
bool ownTile) -> PercentileRollOdds;
auto GetStartFireOdds(
[[nodiscard]] auto GetStartFireOdds(
const SettingsGetter &settings,
const Terrain &terrain,
const WeatherFb &currentWeather,
@@ -36,25 +36,19 @@ public:
using BaseType::BaseType;
// Default constructor
GameStateW() : BaseType() {}
GameStateW() = default;
// Copy constructor
GameStateW(const GameStateW& other) : BaseType(other) {}
GameStateW(const GameStateW& other) = default;
// Move constructor
GameStateW(GameStateW&& other) noexcept : BaseType(std::move(other)) {}
GameStateW(GameStateW&& other) noexcept = default;
// Copy assignment
GameStateW& operator=(const GameStateW& other) {
BaseType::operator=(other);
return *this;
}
GameStateW& operator=(const GameStateW& other) = default;
// Move assignment
GameStateW& operator=(GameStateW&& other) noexcept {
BaseType::operator=(std::move(other));
return *this;
}
GameStateW& operator=(GameStateW&& other) noexcept = default;
// Constructor from base type
GameStateW(const BaseType& base) : BaseType(base) {}
@@ -42,7 +42,7 @@ private:
[[nodiscard]] virtual auto InternalExecute(
const GameStateW& currentState,
const std::shared_ptr<RandomGenerator>& generator) const -> std::vector<ActionResult> {
return InternalExecuteWithRoll(currentState, generator, std::optional<int32_t>());
return InternalExecuteWithRoll(currentState, generator, std::nullopt);
}
[[nodiscard]] virtual auto InternalExecuteWithRoll(
@@ -43,7 +43,7 @@ protected:
const std::shared_ptr<BraveableTileInfo> &braveWaterPossibleCoords,
const std::vector<Coords> &indexToCoords,
const std::vector<std::array<int, 6>> &adjacencyTable);
static auto GenerateDistances(
[[nodiscard]] static auto GenerateDistances(
int fromIndex,
const HexMap *hexMap,
bool includeBravingWater,
@@ -51,13 +51,15 @@ protected:
const BattalionTypeSPtr &battalionType,
const std::shared_ptr<BraveableTileInfo> &braveWaterPossibleCoords)
-> std::vector<DIST_T>;
auto BraveWaterPossibleCoords(const HexMap *hexMap) const -> std::shared_ptr<BraveableTileInfo>;
[[nodiscard]] auto BraveWaterPossibleCoords(const HexMap *hexMap) const
-> std::shared_ptr<BraveableTileInfo>;
// Create coordinate lookup table for efficient index->coords conversion
static auto CreateIndexToCoords(const HexMap *hexMap) -> std::vector<Coords>;
[[nodiscard]] static auto CreateIndexToCoords(const HexMap *hexMap) -> std::vector<Coords>;
// Create adjacency lookup table for efficient neighbor access
static auto CreateAdjacencyTable(const HexMap *hexMap) -> std::vector<std::array<int, 6>>;
[[nodiscard]] static auto CreateAdjacencyTable(const HexMap *hexMap)
-> std::vector<std::array<int, 6>>;
[[nodiscard]] auto ToIndex(const Coords &coords) const -> int {
return coords.row() * column_count + coords.column();
@@ -70,9 +72,9 @@ public:
virtual ~ActionPointDistances() = default;
virtual auto Distance(int fromIndex, int toIndex) const -> DIST_T = 0;
[[nodiscard]] virtual auto Distance(int fromIndex, int toIndex) const -> DIST_T = 0;
virtual auto Distance(const Coords &from, const Coords &to) const -> DIST_T = 0;
[[nodiscard]] virtual auto Distance(const Coords &from, const Coords &to) const -> DIST_T = 0;
};
class OnDemandActionPointDistances final : public ActionPointDistances {
@@ -91,11 +93,11 @@ public:
~OnDemandActionPointDistances() override = default;
auto Distance(const int fromIndex, const int toIndex) const -> int16_t override {
[[nodiscard]] auto Distance(const int fromIndex, const int toIndex) const -> int16_t override {
return distances[fromIndex].get()[toIndex];
}
auto Distance(const Coords &from, const Coords &to) const -> int16_t override {
[[nodiscard]] auto Distance(const Coords &from, const Coords &to) const -> int16_t override {
return Distance(ToIndex(from), ToIndex(to));
}
};
@@ -22,7 +22,7 @@ struct MapId {
uint64_t terrainTypesId;
uint64_t modifierId;
auto operator==(const MapId& other) const -> bool {
[[nodiscard]] auto operator==(const MapId& other) const -> bool {
return terrainTypesId == other.terrainTypesId && modifierId == other.modifierId;
}
};
@@ -34,7 +34,7 @@ struct FullCacheKey {
bool includeBravingWater;
int braveWaterCost;
bool operator==(const FullCacheKey& other) const {
[[nodiscard]] bool operator==(const FullCacheKey& other) const {
return mapId == other.mapId && battalionTypeId == other.battalionTypeId &&
includeBravingWater == other.includeBravingWater &&
braveWaterCost == other.braveWaterCost;
@@ -43,7 +43,7 @@ struct FullCacheKey {
// Hash function for FullCacheKey
struct FullCacheKeyHash {
size_t operator()(const FullCacheKey& key) const {
[[nodiscard]] size_t operator()(const FullCacheKey& key) const {
// Pack small fields into a single 64-bit value
uint64_t packed = (static_cast<uint64_t>(key.battalionTypeId) << 32) |
(static_cast<uint64_t>(key.braveWaterCost) << 1) |
@@ -85,7 +85,7 @@ private:
// Epoch system removed - TLS cache uses size-based eviction instead
// Helper to build cache key
static auto MakeCacheKey(
[[nodiscard]] static auto MakeCacheKey(
const MapId& mapId,
const BattalionTypeSPtr& battalionType,
bool includeBravingWater,
@@ -107,7 +107,7 @@ public:
bool includeBravingWater,
int braveWaterActionPointCost = -1) -> const ActionPointDistances*;
static auto GetMapId(const HexMap* map) -> MapId;
[[nodiscard]] static auto GetMapId(const HexMap* map) -> MapId;
// Consolidate the thread-safe cache into the persistent cache and clear
// the current thread's local cache. This is only safe if we know reads
@@ -116,7 +116,7 @@ public:
// Cache management methods
static void ClearThreadLocalCache();
static size_t GetThreadLocalCacheSize();
[[nodiscard]] static size_t GetThreadLocalCacheSize();
};
using APDCache = std::shared_ptr<ActionPointDistancesCache>;
@@ -24,7 +24,7 @@ private:
public:
// Factory method to create FixedActionPointDistances
static auto Create(
[[nodiscard]] static auto Create(
const HexMap *map,
const BattalionTypeSPtr &battalionType,
bool includeBravingWater,
@@ -23,11 +23,11 @@ void MutatingApplyResult(
GameStateW& mutatingGameState,
const ActionResultProto& actionResult,
const SettingsGetter& settings);
auto ApplyResult(
[[nodiscard]] auto ApplyResult(
GameStateW startingState,
const ActionResultProto& actionResult,
const SettingsGetter& settings) -> GameStateW;
auto ApplyResults(
[[nodiscard]] auto ApplyResults(
const GameStateW& startingState,
const std::vector<ActionResultProto>& actionResults,
const SettingsGetter& settings) -> GameStateW;
@@ -9,7 +9,8 @@
namespace shardok {
auto CopyWithExtraUnits(const GameStateW& original, int additionalCount) -> GameStateW;
[[nodiscard]] auto CopyWithExtraUnits(const GameStateW& original, int additionalCount)
-> GameStateW;
} // namespace shardok
@@ -90,7 +90,7 @@ auto BurnStructuresResult(const GameStateW &gameState, const SettingsGetter &set
*result.mutable_changed_tile_modifiers() = {burnedTmcs.begin(), burnedTmcs.end()};
return result;
} else {
return std::optional<ActionResultProto>();
return std::nullopt;
}
}
@@ -25,10 +25,9 @@ static inline auto GameIsOver(const GameStatusFb* status) -> bool {
}
auto UpdateGameStatusAction::GetPlayerInfo(int playerId) const -> const PlayerInfoFb* {
return *std::find_if(
std::begin(*gameState->player_infos()),
std::end(*gameState->player_infos()),
[playerId](const PlayerInfoFb* pi) { return pi->player_id() == playerId; });
return *std::ranges::find_if(*gameState->player_infos(), [playerId](const PlayerInfoFb* pi) {
return pi->player_id() == playerId;
});
}
static inline auto HasVictoryCondition(const PlayerInfoFb* pi, const VictoryCondition condition)
@@ -126,7 +126,7 @@ void BraveWaterCommandFactory::AddAvailableBraveWaterCommands(
}
for (const auto &target : braveWaterTargets) {
std::optional<UnitId> ambusher = std::optional<UnitId>();
std::optional<UnitId> ambusher = std::nullopt;
const auto &targetOccupant = Occupant(units, target);
if (targetOccupant) { ambusher = targetOccupant->unit_id(); }
commands.push_back(BraveWaterCommandFactory(settings)
@@ -19,7 +19,7 @@ private:
public:
explicit CommandFactoriesList(const SettingsGetter& settings);
auto GetFactories() const -> std::vector<std::shared_ptr<const CommandFactory>>;
[[nodiscard]] auto GetFactories() const -> std::vector<std::shared_ptr<const CommandFactory>>;
};
} // namespace shardok
@@ -41,7 +41,7 @@ public:
virtual void AddAvailableCommands(CommandList& commands, const CommandParams& params) const = 0;
virtual auto IncludeInFollowUps() const -> bool { return true; }
[[nodiscard]] virtual auto IncludeInFollowUps() const -> bool { return true; }
};
} // namespace shardok
@@ -46,13 +46,13 @@ public:
~ArcheryCommand() override = default;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::ARCHERY_COMMAND;
}
auto CanUseClientRoll() const -> bool override { return true; }
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] int GetActorUnitId() const override { return attackerId; }
[[nodiscard]] MapIndex GetTargetRow() const override { return defenderLocation.row(); }
@@ -32,11 +32,11 @@ public:
~ControlCommand() override = default;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::CONTROL_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto CanBeFollowUp() const -> bool override { return false; }
[[nodiscard]] auto CanDoWithLowMorale() const -> bool override { return true; }
[[nodiscard]] auto CanDoWhileStunned() const -> bool override { return false; }
@@ -41,11 +41,11 @@ public:
[[nodiscard]] auto ExecuteWithRoll(const GameStateW& currentState, double roll) const
-> vector<ActionResult>;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::DISMISS_UNIT_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto CanBeFollowUp() const -> bool override { return false; }
[[nodiscard]] auto CanDoWithLowMorale() const -> bool override { return true; }
[[nodiscard]] auto CanDoWhileStunned() const -> bool override { return false; }
@@ -31,11 +31,11 @@ public:
int agilityXp,
int professionKnowledgeBump);
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::FORTIFY_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] int GetActorUnitId() const override { return fortifyingUnitId; }
};
@@ -37,7 +37,7 @@ public:
return net::eagle0::shardok::common::HIDE_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] int GetActorUnitId() const override { return actorId; }
[[nodiscard]] MapIndex GetTargetRow() const override { return target.row(); }
@@ -51,11 +51,11 @@ public:
~MeleeCommand() override = default;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::MELEE_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
auto CanUseClientRoll() const -> bool override { return true; }
@@ -33,11 +33,11 @@ public:
~MeteorCancelCommand() override = default;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::METEOR_CANCEL_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto IsRequiredToEndTurn() const -> bool override { return requiredToEndTurn; }
[[nodiscard]] auto CanDoWithLowMorale() const -> bool override { return true; }
[[nodiscard]] auto CanDoWithLowVigor() const -> bool override { return true; }
@@ -33,11 +33,11 @@ public:
const CoordsSet& nextRoundTargets);
~MeteorStartCommand() override = default;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::METEOR_START_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] int GetActorUnitId() const override { return casterId; }
};
@@ -38,11 +38,11 @@ public:
~MeteorTargetCommand() override = default;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::METEOR_TARGET_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto IsRequiredToEndTurn() const -> bool override { return requiredToEndTurn; }
[[nodiscard]] auto CanDoWithLowMorale() const -> bool override { return true; }
[[nodiscard]] auto CanDoWithLowVigor() const -> bool override { return true; }
@@ -135,9 +135,8 @@ auto shardok::MoveCommand::InternalExecute(
KnownAdjacentEnemies(player, allUnits, map, allyPids, destination);
for (const Unit* possibleChargee : newAdjacentEnemies) {
if (std::find_if(
knownAdjacentEnemies.begin(),
knownAdjacentEnemies.end(),
if (std::ranges::find_if(
knownAdjacentEnemies,
[possibleChargee](const Unit* adj) {
return adj->unit_id() == possibleChargee->unit_id();
}) == knownAdjacentEnemies.end()) {
@@ -46,11 +46,11 @@ public:
~ReinforceCommand() override = default;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::REINFORCE_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto IsRequiredToEndTurn() const -> bool override { return false; }
[[nodiscard]] auto CanBeFollowUp() const -> bool override { return true; }
@@ -34,7 +34,7 @@ public:
return net::eagle0::shardok::common::RELEASE_UNIT_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto CanBeFollowUp() const -> bool override { return false; }
[[nodiscard]] auto CanDoWithLowMorale() const -> bool override { return true; }
[[nodiscard]] auto CanDoWhileStunned() const -> bool override { return false; }
@@ -57,7 +57,7 @@ public:
return net::eagle0::shardok::common::REPAIR_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto IsRequiredToEndTurn() const -> bool override { return false; }
[[nodiscard]] auto CanBeFollowUp() const -> bool override { return true; }
@@ -55,11 +55,11 @@ public:
[[nodiscard]] auto ExecuteWithRoll(const GameStateW& currentState, double roll) const
-> vector<ActionResult>;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::SCOUT_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto CanBeFollowUp() const -> bool override { return true; }
[[nodiscard]] auto CanDoWithLowMorale() const -> bool override { return false; }
@@ -43,11 +43,11 @@ public:
~StartFireCommand() override = default;
auto GetCommandType() const -> CommandType override {
[[nodiscard]] auto GetCommandType() const -> CommandType override {
return net::eagle0::shardok::common::START_FIRE_COMMAND;
}
auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto GetCommandProto() const -> CommandProto override;
[[nodiscard]] auto CanBeFollowUp() const -> bool override { return true; }
[[nodiscard]] auto CanDoWithLowMorale() const -> bool override { return false; }
@@ -141,7 +141,7 @@ public:
return Wrapper(); // Return empty wrapper for invalid data
}
size_t offset;
size_t offset = 0;
std::memcpy(&offset, str.data(), sizeof(size_t));
size_t size = str.size() - sizeof(size_t);
@@ -159,7 +159,7 @@ public:
return Wrapper(); // Return empty wrapper for invalid data
}
size_t offset;
size_t offset = 0;
std::memcpy(&offset, bv.data(), sizeof(size_t));
size_t size = bv.size() - sizeof(size_t);
@@ -28,7 +28,7 @@ using net::eagle0::shardok::storage::fb::Unit;
using Weather = net::eagle0::shardok::storage::fb::Weather;
using GameStatusProto = net::eagle0::shardok::common::GameStatus;
auto SetupInitialGameState(
[[nodiscard]] auto SetupInitialGameState(
const GameId& gameId,
const HexMapProto& hexMapProto,
const std::vector<PlayerInfoProto>& playerInfoProtos,
@@ -37,14 +37,14 @@ auto SetupInitialGameState(
bool isWinter,
const SettingsGetter& settings) -> GameStateW;
auto FromPlayerInfoProto(
[[nodiscard]] auto FromPlayerInfoProto(
flatbuffers::FlatBufferBuilder& fbb,
const PlayerInfoProto& playerInfoProto)
-> flatbuffers::Offset<net::eagle0::shardok::storage::fb::PlayerInfo>;
auto ToPlayerInfoProto(const PlayerInfo* fbPI) -> PlayerInfoProto;
auto ToWeatherProto(const Weather* fbW) -> net::eagle0::shardok::common::Weather;
auto ToProto(const GameStatus* fbStatus) -> GameStatusProto;
[[nodiscard]] auto ToPlayerInfoProto(const PlayerInfo* fbPI) -> PlayerInfoProto;
[[nodiscard]] auto ToWeatherProto(const Weather* fbW) -> net::eagle0::shardok::common::Weather;
[[nodiscard]] auto ToProto(const GameStatus* fbStatus) -> GameStatusProto;
} // namespace shardok::fb
@@ -22,15 +22,15 @@ using HexMap = net::eagle0::shardok::storage::fb::HexMap;
using HexMapW = Wrapper<HexMap>;
using HexMapProto = net::eagle0::shardok::common::HexMap;
auto ConvertHexMapProto(
[[nodiscard]] auto ConvertHexMapProto(
FlatBufferBuilder& fbb,
const net::eagle0::shardok::common::HexMap& mapProto,
bool isWinter = false,
float initialWinterIceIntegrity = 0.0f) -> Offset<HexMap>;
auto ToProto(const HexMap* hexMap) -> HexMapProto;
[[nodiscard]] auto ToProto(const HexMap* hexMap) -> HexMapProto;
auto CopyHexMap(const HexMap* hexMap) -> HexMapW;
[[nodiscard]] auto CopyHexMap(const HexMap* hexMap) -> HexMapW;
} // namespace shardok::fb
@@ -16,7 +16,7 @@ namespace shardok::fb {
using Terrain = net::eagle0::shardok::storage::fb::Terrain;
using TerrainProto = net::eagle0::shardok::common::Terrain;
auto ToTerrainProto(const Terrain* terrain) -> TerrainProto;
[[nodiscard]] auto ToTerrainProto(const Terrain* terrain) -> TerrainProto;
} // namespace shardok::fb
@@ -16,7 +16,7 @@ namespace shardok::fb {
using TileModifier = net::eagle0::shardok::storage::fb::TileModifier;
using TileModifierProto = net::eagle0::shardok::common::TileModifier;
auto ToTileModifierProto(const TileModifier& tileModifier) -> TileModifierProto;
[[nodiscard]] auto ToTileModifierProto(const TileModifier& tileModifier) -> TileModifierProto;
} // namespace shardok::fb
@@ -23,10 +23,12 @@ namespace shardok {
using Coords = net::eagle0::shardok::storage::fb::Coords;
using CoordsProto = net::eagle0::shardok::common::Coords;
auto MakeCoordsProto(int row, int column) -> net::eagle0::shardok::common::Coords;
[[nodiscard]] auto MakeCoordsProto(int row, int column) -> net::eagle0::shardok::common::Coords;
static inline auto IsUnplaced(const Coords &c) -> bool { return c.row() < 0 || c.column() < 0; }
static inline auto IsUnplaced(const CoordsProto &c) -> bool {
[[nodiscard]] static inline auto IsUnplaced(const Coords &c) -> bool {
return c.row() < 0 || c.column() < 0;
}
[[nodiscard]] static inline auto IsUnplaced(const CoordsProto &c) -> bool {
return c.row() < 0 || c.column() < 0;
}
@@ -41,14 +43,15 @@ static inline auto IsUnplaced(const CoordsProto &c) -> bool {
} // namespace shardok
namespace net::eagle0::shardok::storage::fb {
auto operator==(const Coords &lhs, const net::eagle0::shardok::common::Coords &rhs) -> bool;
[[nodiscard]] auto operator==(const Coords &lhs, const net::eagle0::shardok::common::Coords &rhs)
-> bool;
}
namespace net::eagle0::shardok::common {
auto operator==(
[[nodiscard]] auto operator==(
const net::eagle0::shardok::common::Coords &lhs,
const net::eagle0::shardok::common::Coords &rhs) -> bool;
auto operator==(
[[nodiscard]] auto operator==(
const net::eagle0::shardok::common::Coords &lhs,
const net::eagle0::shardok::storage::fb::Coords &rhs) -> bool;
} // namespace net::eagle0::shardok::common
@@ -56,7 +59,7 @@ auto operator==(
namespace std {
template<>
struct hash<net::eagle0::shardok::common::Coords> {
auto operator()(const net::eagle0::shardok::common::Coords &c) const -> size_t {
[[nodiscard]] auto operator()(const net::eagle0::shardok::common::Coords &c) const -> size_t {
return size_t(c.row() << 16 | c.column());
}
};
@@ -19,7 +19,7 @@ namespace shardok {
constexpr bool kCoordsSetIndexChecks = false;
constexpr size_t STANDARD_SIZE = 12 * 14;
constexpr size_t STANDARD_SIZE = size_t{12} * 14;
using HexMap = net::eagle0::shardok::storage::fb::HexMap;
using BackingBitset = common::IterableBitset<168>;
@@ -34,7 +34,7 @@ private:
uint32_t indexCount;
[[nodiscard]] auto Index(const int row, const int column) const -> int {
return row * mapWidth + column;
return (row * mapWidth) + column;
}
[[nodiscard]] auto Index(const Coords& c) const -> int { return Index(c.row(), c.column()); }
@@ -41,11 +41,11 @@ inline HexMapDirection& operator++(HexMapDirection& dir) {
}
struct HexMapDirectionsTo {
HexMapDirection main;
HexMapDirection secondary; // Only valid if exactly on the line
bool usesSecondary;
HexMapDirection main{};
HexMapDirection secondary{}; // Only valid if exactly on the line
bool usesSecondary{};
bool Matches(const HexMapDirection dir) {
bool Matches(const HexMapDirection dir) const {
return dir == main || (usesSecondary && dir == secondary);
}
};
@@ -13,13 +13,13 @@
namespace shardok {
using HexMap = net::eagle0::shardok::storage::fb::HexMap;
auto GetModifierHash(const HexMap* map) -> uint64_t;
[[nodiscard]] auto GetModifierHash(const HexMap* map) -> uint64_t;
// Helper function to compute modifier byte for consistent hashing
// Excludes ice from hash since AI pathfinding should ignore ice
// Compact bit layout: bridge=bit0, fire=bit1, snow=bit2
template<typename TileModifier>
auto ComputeModifierByte(const TileModifier& modifier) -> int8_t {
[[nodiscard]] auto ComputeModifierByte(const TileModifier& modifier) -> int8_t {
return static_cast<int8_t>(
modifier.bridge().present() | modifier.fire().present() << 1 |
modifier.snow().present() << 2);
@@ -27,7 +27,7 @@ auto ComputeModifierByte(const TileModifier& modifier) -> int8_t {
// Overload for protobuf modifier
template<typename ProtoModifier>
auto ComputeModifierByteProto(const ProtoModifier& modifier) -> int8_t {
[[nodiscard]] auto ComputeModifierByteProto(const ProtoModifier& modifier) -> int8_t {
return static_cast<int8_t>(
modifier.has_bridge() | modifier.has_fire() << 1 | modifier.has_snow() << 2);
}
@@ -34,23 +34,25 @@ using TerrainType::Terrain_Type_UNKNOWN;
constexpr int kTerrainTypeCount = net::eagle0::shardok::common::Terrain_Type_Type_ARRAYSIZE;
auto AllowsHiding(const Terrain* terrain) -> bool;
auto AllowsHiding(net::eagle0::shardok::storage::fb::Terrain_::Type type) -> bool;
auto AllowsHiding(const net::eagle0::shardok::storage::fb::TileModifier& modifier) -> bool;
[[nodiscard]] auto AllowsHiding(const Terrain* terrain) -> bool;
[[nodiscard]] auto AllowsHiding(net::eagle0::shardok::storage::fb::Terrain_::Type type) -> bool;
[[nodiscard]] auto AllowsHiding(const net::eagle0::shardok::storage::fb::TileModifier& modifier)
-> bool;
auto AllowsHiding(const TerrainProto& terrain) -> bool;
auto AllowsHiding(TerrainType type) -> bool;
auto AllowsHiding(const TileModifierProto& modifier) -> bool;
[[nodiscard]] auto AllowsHiding(const TerrainProto& terrain) -> bool;
[[nodiscard]] auto AllowsHiding(TerrainType type) -> bool;
[[nodiscard]] auto AllowsHiding(const TileModifierProto& modifier) -> bool;
auto AllowsFortification(const Terrain* terrain) -> bool;
[[nodiscard]] auto AllowsFortification(const Terrain* terrain) -> bool;
auto IsWater(net::eagle0::shardok::storage::fb::Terrain_::Type type) -> bool;
auto IsWater(TerrainType type) -> bool;
[[nodiscard]] auto IsWater(net::eagle0::shardok::storage::fb::Terrain_::Type type) -> bool;
[[nodiscard]] auto IsWater(TerrainType type) -> bool;
auto IsTraversible(const net::eagle0::shardok::storage::fb::Terrain& terrain) -> bool;
[[nodiscard]] auto IsTraversible(const net::eagle0::shardok::storage::fb::Terrain& terrain) -> bool;
auto MakeHexMapTerrain(TerrainType tp, TileModifierProto mod = TileModifierProto()) -> TerrainProto;
auto MakeHexMapTerrain(
[[nodiscard]] auto MakeHexMapTerrain(TerrainType tp, TileModifierProto mod = TileModifierProto())
-> TerrainProto;
[[nodiscard]] auto MakeHexMapTerrain(
net::eagle0::shardok::storage::fb::Terrain_::Type tp,
const net::eagle0::shardok::storage::fb::TileModifier& mod =
net::eagle0::shardok::storage::fb::TileModifier()) -> Terrain;
@@ -23,7 +23,7 @@ namespace shardok {
using SingleModifier = net::eagle0::shardok::common::TileModifier_SingleModifier;
using TileModifierProto = net::eagle0::shardok::common::TileModifier;
SingleModifier MakeSingleModifier(const std::optional<double>& integ = std::optional<double>());
SingleModifier MakeSingleModifier(const std::optional<double>& integ = std::nullopt);
bool operator==(const SingleModifier& lhs, const SingleModifier& rhs);
@@ -76,7 +76,7 @@ public:
return settings.backingStruct;
}
[[nodiscard]] auto GetRandomGenerator() const -> const std::shared_ptr<RandomGenerator> {
[[nodiscard]] auto GetRandomGenerator() const -> std::shared_ptr<RandomGenerator> {
return settings.randomGenerator;
}
@@ -22,12 +22,12 @@ namespace shardok {
using Unit = net::eagle0::shardok::storage::fb::Unit;
using Units = flatbuffers::Vector<const Unit *>;
auto IsDestroyed(const Unit &unit) -> bool;
[[nodiscard]] auto IsDestroyed(const Unit &unit) -> bool;
auto MaxActionPoints(const Unit &unit) -> ActionPoints;
[[nodiscard]] auto MaxActionPoints(const Unit &unit) -> ActionPoints;
auto OpponentKnowledge(const Unit &unit, PlayerId toPlayer) -> int;
auto OpponentKnowledge(const Unit *unit, PlayerId toPlayer) -> int;
[[nodiscard]] auto OpponentKnowledge(const Unit &unit, PlayerId toPlayer) -> int;
[[nodiscard]] auto OpponentKnowledge(const Unit *unit, PlayerId toPlayer) -> int;
// Returns the casualty count.
auto MutatingApplyDamageFrom(
@@ -50,7 +50,7 @@ auto MutatingApplyEnvironmentalDamage(
double baseDeadliness,
const BattalionTypeSPtr &type) -> int32_t;
auto WithTakenDamageFb(
[[nodiscard]] auto WithTakenDamageFb(
const Unit *victim,
const CombatDamage &amount,
const Terrain &terrain,
@@ -71,8 +71,10 @@ void MutatingBumpCharismaXp(Unit *unit, int newXp);
void MutatingBumpOpponentKnowledge(Unit *unit, PlayerId pid, int bump);
void MutatingBumpAllKnowledgeToMinimum(Unit *unit, int bump);
auto ReserveUnitsForPlayer(const Units *units, PlayerId pid) -> std::map<UnitId, const Unit *>;
auto PlacedUnitsForPlayer(const Units *units, PlayerId pid) -> std::map<UnitId, const Unit *>;
[[nodiscard]] auto ReserveUnitsForPlayer(const Units *units, PlayerId pid)
-> std::map<UnitId, const Unit *>;
[[nodiscard]] auto PlacedUnitsForPlayer(const Units *units, PlayerId pid)
-> std::map<UnitId, const Unit *>;
} // namespace shardok
@@ -111,8 +111,8 @@ auto CombatUtils::CalculateUnitDamageGiven(
const bool hasHero = unit->has_attached_hero();
CombatDamage battalionDamage = CalculateBattalionDamageGiven(
unit->battalion(),
(hasHero ? unit->attached_hero().charisma() : std::optional<double>()),
(hasHero ? unit->attached_hero().bravery() : std::optional<double>()),
(hasHero ? std::optional<double>{unit->attached_hero().charisma()} : std::nullopt),
(hasHero ? std::optional<double>{unit->attached_hero().bravery()} : std::nullopt),
battalionRoll,
settings);
@@ -20,20 +20,20 @@ struct Cube {
Cube(const int16_t x, const int16_t y, const int16_t z) : x(x), y(y), z(z) {}
};
auto OffsetToCube(const Coords &c) -> Cube;
[[nodiscard]] auto OffsetToCube(const Coords &c) -> Cube;
auto CubeToOffset(const Cube &cube) -> Coords;
[[nodiscard]] auto CubeToOffset(const Cube &cube) -> Coords;
static inline auto CubeDistance(const Cube &c1, const Cube &c2) -> int {
[[nodiscard]] static inline auto CubeDistance(const Cube &c1, const Cube &c2) -> int {
return (abs(c1.x - c2.x) + abs(c1.y - c2.y) + abs(c1.z - c2.z)) / 2;
}
auto CubesWithinDistance(const Cube &c1, int distance) -> std::vector<Cube>;
auto CubesWithExactDistance(const Cube &c1, int distance) -> std::vector<Cube>;
[[nodiscard]] auto CubesWithinDistance(const Cube &c1, int distance) -> std::vector<Cube>;
[[nodiscard]] auto CubesWithExactDistance(const Cube &c1, int distance) -> std::vector<Cube>;
// Returns all the hexes that are on the line between c1 and c2, including the endpoints.
// In a case where the line passes exactly between two hexes, includes BOTH hexes.
auto CubeLineInclusive(const Cube &c1, const Cube &c2) -> std::vector<Cube>;
[[nodiscard]] auto CubeLineInclusive(const Cube &c1, const Cube &c2) -> std::vector<Cube>;
} // namespace shardok
@@ -173,7 +173,7 @@ auto Occupant(const UnitContainer &units, const Coords &coords)
if (unit.location() == coords) { return unit; }
}
return std::optional<typename UnitContainer::value_type>();
return std::nullopt;
}
template<class U>
@@ -182,7 +182,7 @@ auto Occupant(const std::map<UnitId, U> &units, const Coords &coords) -> std::op
if (unit.location() == coords) { return unit; }
}
return std::optional<U>();
return std::nullopt;
}
template<class U>
@@ -192,7 +192,7 @@ auto Occupant(const ::google::protobuf::Map<UnitId, U> &units, const Coords &coo
if (unit.location() == coords) { return unit; }
}
return std::optional<U>();
return std::nullopt;
}
template<class U, class UnitContainer>
@@ -201,7 +201,7 @@ auto Occupant(const UnitContainer &units, const Coords &coords) -> std::optional
if (unit.location() == coords) { return unit; }
}
return std::optional<U>();
return std::nullopt;
}
static inline auto FriendlyOccupant(
@@ -258,7 +258,7 @@ auto KnownEnemyOccupant(
}
}
return std::optional<typename UnitContainer::value_type>();
return std::nullopt;
}
[[nodiscard]] static inline auto KnownOccupant(
@@ -10,7 +10,7 @@
namespace shardok {
auto CoordsInMeteorRange(
[[nodiscard]] auto CoordsInMeteorRange(
const HexMap *hexMap,
const Coords &location,
const SettingsGetter &settings) -> CoordsSet;
@@ -7,9 +7,8 @@
namespace shardok {
auto PlayerIsDefender(const GameState *gameState, int playerId) -> bool {
const auto playerInfo = std::find_if(
std::begin(*gameState->player_infos()),
std::end(*gameState->player_infos()),
const auto playerInfo = std::ranges::find_if(
*gameState->player_infos(),
[playerId](const auto *pi) { return pi->player_id() == playerId; });
if (playerInfo == std::end(*gameState->player_infos())) return false;
@@ -32,12 +31,11 @@ auto NextPlayerId(const GameState *gameState, const PlayerId pid, const bool all
auto AlliedPids(const GameState *gameState, int playerId) -> std::vector<PlayerId> {
if (gameState->player_infos() == nullptr) return {};
const auto &pi = std::find_if(
std::begin(*gameState->player_infos()),
std::end(*gameState->player_infos()),
const auto &pi = std::ranges::find_if(
*gameState->player_infos(),
[playerId](const PlayerInfoFb *pi) { return pi->player_id() == playerId; });
if (pi == std::end(*gameState->player_infos())) { return std::vector<PlayerId>{}; }
if (pi == std::end(*gameState->player_infos())) { return {}; }
std::vector<PlayerId> allyPids{};
if (pi->allies()) {
@@ -15,10 +15,10 @@ namespace shardok {
using PlayerInfoFb = net::eagle0::shardok::storage::fb::PlayerInfo;
using GameState = net::eagle0::shardok::storage::fb::GameState;
auto PlayerIsDefender(const GameState *gameState, int playerId) -> bool;
auto NextPlayerId(const GameState *gameState, PlayerId pid, bool allowUncontrolled = true)
-> PlayerId;
auto AlliedPids(const GameState *gameState, int playerId) -> std::vector<PlayerId>;
[[nodiscard]] auto PlayerIsDefender(const GameState *gameState, int playerId) -> bool;
[[nodiscard]] auto
NextPlayerId(const GameState *gameState, PlayerId pid, bool allowUncontrolled = true) -> PlayerId;
[[nodiscard]] auto AlliedPids(const GameState *gameState, int playerId) -> std::vector<PlayerId>;
} // namespace shardok
@@ -13,11 +13,12 @@
#include "src/main/protobuf/net/eagle0/shardok/common/weather.pb.h"
#pragma GCC diagnostic pop
auto MakeWind(net::eagle0::shardok::common::HexMapDirection direction, int32_t speedInMph)
-> net::eagle0::shardok::common::Weather::Wind;
auto MakeWeather(
[[nodiscard]] auto MakeWind(
net::eagle0::shardok::common::HexMapDirection direction,
int32_t speedInMph) -> net::eagle0::shardok::common::Weather::Wind;
[[nodiscard]] auto MakeWeather(
net::eagle0::shardok::common::Weather::Conditions conditions,
net::eagle0::shardok::common::Weather::Wind wind) -> net::eagle0::shardok::common::Weather;
auto MonthIsWinter(int month) -> bool;
[[nodiscard]] auto MonthIsWinter(int month) -> bool;
#endif // EAGLE0_SHARDOK_LIBRARY_UTIL_WEATHER_HELPERS_HPP
@@ -107,7 +107,7 @@ auto TargetIsHiddenFromOpponents(const ActionResultType type) -> bool {
hiddenActor,
wasHidden) &&
!actorIsSelfOrAlly) {
return std::optional<ActionResultView>();
return std::nullopt;
}
ActionResultView resultView{};
@@ -258,7 +258,7 @@ auto GameStateGuesser::GuessedState(
}
for (int i = 0; i < maxId; ++i) {
auto entry = std::find(std::begin(foundUnits), std::end(foundUnits), i);
auto entry = std::ranges::find(foundUnits, i);
if (entry == std::end(foundUnits)) {
net::eagle0::shardok::storage::fb::Unit newUnit;
newUnit.mutate_unit_id(i);
@@ -25,13 +25,13 @@ struct AverageStats {
double training;
};
auto KnownUnitStats(const GameStateView &gameStateView)
[[nodiscard]] auto KnownUnitStats(const GameStateView &gameStateView)
-> std::unordered_map<PlayerId, AverageStats>;
// Guess where an enemy mage might be targeting with their meteor.
// Priority: (1) largest unit of targetPlayerId, (2) any unit of targetPlayerId,
// (3) any castle not occupied by the caster's player, (4) first valid tile in range.
auto GuessMeteorTarget(
[[nodiscard]] auto GuessMeteorTarget(
const SettingsGetter &settings,
const HexMapProto &hexMap,
const Coords &mageLocation,
@@ -161,7 +161,7 @@ auto MakeGameStateViewDiff(const GameStateView &before, const GameStateView &aft
}
}
return changed ? diff : std::optional<GameStateViewDiff>();
return changed ? std::optional<GameStateViewDiff>{diff} : std::nullopt;
}
} // namespace shardok
@@ -276,7 +276,7 @@ auto EagleInterfaceImpl::PostCommand(
request->token(),
request->index(),
request->has_roll() ? std::optional<int32_t>(request->roll().value())
: std::optional<int32_t>());
: std::nullopt);
}
{
@@ -175,7 +175,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: -15, y: -124}
m_SizeDelta: {x: 160, y: 35}
m_SizeDelta: {x: 160, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4709387620957914250
CanvasRenderer:
@@ -536,7 +536,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 151, y: -124}
m_SizeDelta: {x: 160, y: 35}
m_SizeDelta: {x: 160, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7560905983355139690
CanvasRenderer:
@@ -7990,7 +7990,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 20}
m_SizeDelta: {x: 0, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2617165890227550574
MonoBehaviour:
@@ -5352,7 +5352,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 20}
m_SizeDelta: {x: 0, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &9214994086727143013
MonoBehaviour:
@@ -1072,9 +1072,9 @@ MonoBehaviour:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.LayoutElement
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: 28
m_MinHeight: 44
m_PreferredWidth: -1
m_PreferredHeight: 30
m_PreferredHeight: 44
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -8158,9 +8158,9 @@ MonoBehaviour:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.LayoutElement
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: 28
m_MinHeight: 44
m_PreferredWidth: -1
m_PreferredHeight: 30
m_PreferredHeight: 44
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -1092,7 +1092,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 141, y: -16}
m_SizeDelta: {x: 218, y: 20}
m_SizeDelta: {x: 218, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &7671732118854833925
MonoBehaviour:
@@ -1173,7 +1173,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: 20
m_PreferredHeight: 44
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -176,7 +176,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: 410}
m_SizeDelta: {x: 528.3, y: 32.6}
m_SizeDelta: {x: 528.3, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224798258896322370
RectTransform:
@@ -802,7 +802,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: -15, y: -124}
m_SizeDelta: {x: 160, y: 35}
m_SizeDelta: {x: 160, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &65327892
MonoBehaviour:
@@ -4360,7 +4360,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 540, y: -20}
m_SizeDelta: {x: 300, y: 40}
m_SizeDelta: {x: 300, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &388979520
MonoBehaviour:
@@ -5189,7 +5189,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 540, y: -100}
m_SizeDelta: {x: 300, y: 40}
m_SizeDelta: {x: 300, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &478616035
MonoBehaviour:
@@ -7393,7 +7393,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 540, y: -60}
m_SizeDelta: {x: 300, y: 40}
m_SizeDelta: {x: 300, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &690908523
MonoBehaviour:
@@ -12909,7 +12909,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 20}
m_SizeDelta: {x: 0, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1259883509
MonoBehaviour:
@@ -13896,7 +13896,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 240, y: -60}
m_SizeDelta: {x: 300, y: 40}
m_SizeDelta: {x: 300, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1329927116
MonoBehaviour:
@@ -16285,7 +16285,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 495, y: -21.428572}
m_SizeDelta: {x: 150, y: 42.857143}
m_SizeDelta: {x: 150, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1636735658
MonoBehaviour:
@@ -16519,7 +16519,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 240, y: -100}
m_SizeDelta: {x: 300, y: 40}
m_SizeDelta: {x: 300, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1653336955
MonoBehaviour:
@@ -17474,7 +17474,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1071, y: -20}
m_SizeDelta: {x: 200, y: 40}
m_SizeDelta: {x: 200, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1730376449
MonoBehaviour:
@@ -18141,7 +18141,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 151, y: -124}
m_SizeDelta: {x: 160, y: 35}
m_SizeDelta: {x: 160, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1793816978
MonoBehaviour:
@@ -20794,7 +20794,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 240, y: -20}
m_SizeDelta: {x: 300, y: 40}
m_SizeDelta: {x: 300, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2098264579
MonoBehaviour:
@@ -16238,7 +16238,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 767.5, y: -17.5}
m_SizeDelta: {x: 225, y: 35}
m_SizeDelta: {x: 225, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &128680686
MonoBehaviour:
@@ -16256,7 +16256,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 225
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -16540,7 +16540,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 180
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -16564,7 +16564,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 541.01166, y: -16.5}
m_SizeDelta: {x: 162.49026, y: 33}
m_SizeDelta: {x: 162.49026, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &130723794
GameObject:
@@ -18643,7 +18643,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 220
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -18667,7 +18667,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 960.1557, y: -16.5}
m_SizeDelta: {x: 198.59923, y: 33}
m_SizeDelta: {x: 198.59923, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &146542080
GameObject:
@@ -21712,7 +21712,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 225
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -21736,7 +21736,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 767.5, y: -17.5}
m_SizeDelta: {x: 225, y: 35}
m_SizeDelta: {x: 225, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &170172716
GameObject:
@@ -28272,7 +28272,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 225
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -28296,7 +28296,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 522.5, y: -17.5}
m_SizeDelta: {x: 225, y: 35}
m_SizeDelta: {x: 225, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &223285885
GameObject:
@@ -32744,7 +32744,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 410.35156, y: -230.07692}
m_SizeDelta: {x: 810.7031, y: 25.846155}
m_SizeDelta: {x: 810.7031, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &249661625
MonoBehaviour:
@@ -49341,7 +49341,7 @@ RectTransform:
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -10, y: 0}
m_SizeDelta: {x: 32, y: 32}
m_SizeDelta: {x: 44, y: 44}
m_Pivot: {x: 1, y: 0.5}
--- !u!1 &359802942
GameObject:
@@ -58323,7 +58323,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 245
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -58347,7 +58347,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 204.09793, y: -12.923078}
m_SizeDelta: {x: 131.69049, y: 25.846155}
m_SizeDelta: {x: 131.69049, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &430837821
GameObject:
@@ -59823,7 +59823,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 650, y: -225.5}
m_SizeDelta: {x: 1290, y: 35}
m_SizeDelta: {x: 1290, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &440103821
MonoBehaviour:
@@ -62550,7 +62550,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 640, y: -211.5}
m_SizeDelta: {x: 1280, y: 33}
m_SizeDelta: {x: 1280, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &459221576
MonoBehaviour:
@@ -63253,7 +63253,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 225
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -63277,7 +63277,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 522.5, y: -17.5}
m_SizeDelta: {x: 225, y: 35}
m_SizeDelta: {x: 225, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &465743287
GameObject:
@@ -77375,7 +77375,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 220
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -77399,7 +77399,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 465.82172, y: -12.923078}
m_SizeDelta: {x: 118.25268, y: 25.846155}
m_SizeDelta: {x: 118.25268, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &547659159
GameObject:
@@ -92966,7 +92966,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 180
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -92990,7 +92990,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 338.31927, y: -12.923078}
m_SizeDelta: {x: 96.75219, y: 25.846155}
m_SizeDelta: {x: 96.75219, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &660980321
GameObject:
@@ -116191,7 +116191,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 90, y: -89}
m_SizeDelta: {x: 180, y: 35}
m_SizeDelta: {x: 180, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &810386121
MonoBehaviour:
@@ -116209,7 +116209,7 @@ MonoBehaviour:
m_MinWidth: 0
m_MinHeight: -1
m_PreferredWidth: 180
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -118579,7 +118579,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 141, y: -16}
m_SizeDelta: {x: 218, y: 20}
m_SizeDelta: {x: 218, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &827047613
MonoBehaviour:
@@ -118597,7 +118597,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: 20
m_PreferredHeight: 44
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -141132,7 +141132,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 20}
m_SizeDelta: {x: 0, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &990335414
MonoBehaviour:
@@ -145011,7 +145011,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 945, y: -20}
m_SizeDelta: {x: 200, y: 30}
m_SizeDelta: {x: 200, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1013253111
MonoBehaviour:
@@ -145059,7 +145059,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 200
m_PreferredHeight: 30
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: 0
m_LayoutPriority: 1
@@ -148728,7 +148728,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1195, y: -12}
m_SizeDelta: {x: 100, y: 24}
m_SizeDelta: {x: 100, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1042458708
MonoBehaviour:
@@ -175058,7 +175058,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1012.5, y: -17.5}
m_SizeDelta: {x: 225, y: 35}
m_SizeDelta: {x: 225, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1262731469
MonoBehaviour:
@@ -175076,7 +175076,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 225
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -175445,7 +175445,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 245
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -175469,7 +175469,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 329.1829, y: -16.5}
m_SizeDelta: {x: 221.16731, y: 33}
m_SizeDelta: {x: 221.16731, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1265208538
GameObject:
@@ -204005,7 +204005,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 220
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -204029,7 +204029,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 59.126343, y: -12.923078}
m_SizeDelta: {x: 118.25268, y: 25.846155}
m_SizeDelta: {x: 118.25268, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1467173694
GameObject:
@@ -259963,7 +259963,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 650, y: -225.5}
m_SizeDelta: {x: 1290, y: 35}
m_SizeDelta: {x: 1290, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1842440878
MonoBehaviour:
@@ -263166,7 +263166,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 90, y: -134}
m_SizeDelta: {x: 180, y: 35}
m_SizeDelta: {x: 180, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1868787946
MonoBehaviour:
@@ -263184,7 +263184,7 @@ MonoBehaviour:
m_MinWidth: 0
m_MinHeight: -1
m_PreferredWidth: 180
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -272110,7 +272110,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 225
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -272134,7 +272134,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 277.5, y: -17.5}
m_SizeDelta: {x: 225, y: 35}
m_SizeDelta: {x: 225, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1932891756
GameObject:
@@ -276432,7 +276432,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 90, y: -44}
m_SizeDelta: {x: 180, y: 35}
m_SizeDelta: {x: 180, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1969473728
MonoBehaviour:
@@ -276450,7 +276450,7 @@ MonoBehaviour:
m_MinWidth: 0
m_MinHeight: -1
m_PreferredWidth: 180
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -278940,7 +278940,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 220
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -278964,7 +278964,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 741.55646, y: -16.5}
m_SizeDelta: {x: 198.59923, y: 33}
m_SizeDelta: {x: 198.59923, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1981896738
GameObject:
@@ -297066,7 +297066,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 220
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -297090,7 +297090,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 604.0744, y: -12.923078}
m_SizeDelta: {x: 118.25268, y: 25.846155}
m_SizeDelta: {x: 118.25268, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2093294539
GameObject:
@@ -299551,7 +299551,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 220
m_PreferredHeight: 35
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -299575,7 +299575,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 99.29962, y: -16.5}
m_SizeDelta: {x: 198.59923, y: 33}
m_SizeDelta: {x: 198.59923, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2119216695
GameObject:
@@ -4457,9 +4457,9 @@ MonoBehaviour:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.LayoutElement
m_IgnoreLayout: 0
m_MinWidth: 65
m_MinHeight: 20
m_MinHeight: 44
m_PreferredWidth: 65
m_PreferredHeight: 20
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: 0
m_LayoutPriority: 1
@@ -4489,7 +4489,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 94.005, y: -24.510002}
m_SizeDelta: {x: 65, y: 20}
m_SizeDelta: {x: 65, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &348932677
GameObject:
@@ -4823,7 +4823,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 715, y: -20}
m_SizeDelta: {x: 150, y: 30}
m_SizeDelta: {x: 150, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &356069265
MonoBehaviour:
@@ -4841,7 +4841,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 150
m_PreferredHeight: 30
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: 0
m_LayoutPriority: 1
@@ -13973,7 +13973,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 545, y: -20}
m_SizeDelta: {x: 150, y: 30}
m_SizeDelta: {x: 150, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1233815601
MonoBehaviour:
@@ -13991,7 +13991,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 150
m_PreferredHeight: 30
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: 0
m_LayoutPriority: 1
@@ -15368,7 +15368,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 745, y: -1060}
m_SizeDelta: {x: 100, y: 30}
m_SizeDelta: {x: 100, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1384573208
MonoBehaviour:
@@ -15386,7 +15386,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 100
m_PreferredHeight: 30
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: -1
m_LayoutPriority: 1
@@ -20365,7 +20365,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 730, y: -20}
m_SizeDelta: {x: 120, y: 40}
m_SizeDelta: {x: 120, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1731381190
MonoBehaviour:
@@ -20383,7 +20383,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 120
m_PreferredHeight: 40
m_PreferredHeight: 44
m_FlexibleWidth: 0
m_FlexibleHeight: 0
m_LayoutPriority: 1
@@ -118,7 +118,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -25}
m_SizeDelta: {x: 400, y: 30}
m_SizeDelta: {x: 400, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1803372434853685144
CanvasRenderer:
@@ -87,7 +87,7 @@ abstract class FunctionalRandom {
if rem == 0 then acc
else go(rem - 1, gen(acc.nextRandom).map(acc.newValue :+ _))
go(count, RandomState(Vector(), this))
go(count, RandomState(Vector.empty, this))
}
def nextPair[T](
@@ -233,7 +233,7 @@ abstract class FunctionalRandom {
case _ => accRS
}
go(vec, RandomState(Vector(), this))
go(vec, RandomState(Vector.empty, this))
}
def nextCollectFirst[T, U](seq: Seq[T])(
@@ -268,7 +268,7 @@ abstract class FunctionalRandom {
case _ => ??? // above cases should cover
}
go(vec, RandomState(Vector(), this))
go(vec, RandomState(Vector.empty, this))
}
def nextFlatCollectFirst[T, U](seq: Seq[T])(
@@ -35,7 +35,7 @@ object StringConstructionTester {
arraysUrl = Path.of(arraysPath).toUri.toURL,
formatUrl = Path.of(formatPath).toUri.toURL,
substitutions = newSubs,
atSpecializations = Vector()
atSpecializations = Vector.empty
)
val random = new JankyRandom(new Random())
@@ -123,7 +123,7 @@ case class TitleCaseToken(base: StringConstructionToken) extends StringConstruct
case first +: middle :+ last =>
first.capitalize +: middle :+ last.capitalize
case Vector(only: String) => Vector(only.capitalize)
case Vector() => Vector()
case Vector() => Vector.empty
}
private def byWordCapitalized(string: String): Vector[String] =
@@ -16,7 +16,7 @@ object StringConstructionTokenGenerator {
namesMap: Map[String, Vector[String]],
formatString: String,
atSpecializations: Vector[String],
substitutions: Map[String, String] = Map()
substitutions: Map[String, String] = Map.empty
): StringConstructionToken = {
val formatStringWithSubstitutions = substitutions.foldLeft(formatString) {
case (acc, (key, value)) =>
+1 -1
View File
@@ -78,7 +78,7 @@ object Main {
case _ => map
}
nextOption(Map(), args.toVector)
nextOption(Map.empty, args.toVector)
}
def main(args: Array[String]): Unit = {
@@ -113,15 +113,13 @@ object JwtService {
* Some(JwtService) if keys are available, None otherwise
*/
def fromEnvironment(): Option[JwtService] = {
val pathOpt = sys.env.get("JWT_PUBLIC_KEY_FILE").filter(_.trim.nonEmpty) match {
case Some(p) => Some(p)
case None =>
val defaultFile = new java.io.File(defaultPublicKeyPath)
if defaultFile.exists() then Some(defaultPublicKeyPath)
else {
println(s"[JwtService] No public key found (checked JWT_PUBLIC_KEY_FILE env and $defaultPublicKeyPath)")
None
}
val pathOpt = sys.env.get("JWT_PUBLIC_KEY_FILE").filter(_.trim.nonEmpty).orElse {
val defaultFile = new java.io.File(defaultPublicKeyPath)
if defaultFile.exists() then Some(defaultPublicKeyPath)
else {
println(s"[JwtService] No public key found (checked JWT_PUBLIC_KEY_FILE env and $defaultPublicKeyPath)")
None
}
}
pathOpt.flatMap { path =>
@@ -239,7 +239,7 @@ class OAuthServiceImpl(serverBaseUrl: String) extends OAuthService {
val accessToken = (parsed \ "access_token").extract[String]
Right(accessToken)
}
}.toEither.left.map(e => s"Token exchange error: ${e.getMessage}").flatten
}.toEither.fold(e => Left(s"Token exchange error: ${e.getMessage}"), identity)
private def fetchUserInfo(
provider: OAuthProvider,
@@ -265,7 +265,7 @@ class OAuthServiceImpl(serverBaseUrl: String) extends OAuthService {
val parsed = json.parse(body)
parseUserInfo(provider, parsed)
}
}.toEither.left.map(e => s"User info fetch error: ${e.getMessage}").flatten
}.toEither.fold(e => Left(s"User info fetch error: ${e.getMessage}"), identity)
private def parseUserInfo(
provider: OAuthProvider,
@@ -365,7 +365,7 @@ class OAuthServiceImpl(serverBaseUrl: String) extends OAuthService {
Right(signedJWT.serialize())
}
}.toEither.left.map(e => s"Failed to generate Apple client_secret: ${e.getMessage}").flatten
}.toEither.fold(e => Left(s"Failed to generate Apple client_secret: ${e.getMessage}"), identity)
/** Exchange Apple authorization code for tokens */
private def exchangeAppleCode(
@@ -405,7 +405,7 @@ class OAuthServiceImpl(serverBaseUrl: String) extends OAuthService {
} else {
Right(json.parse(body))
}
}.toEither.left.map(e => s"Apple token exchange error: ${e.getMessage}").flatten
}.toEither.fold(e => Left(s"Apple token exchange error: ${e.getMessage}"), identity)
/** Parse user info from Apple's id_token JWT */
private def parseAppleIdToken(tokenResponse: org.json4s.JValue): Either[String, ProviderUserInfo] =
@@ -431,5 +431,5 @@ class OAuthServiceImpl(serverBaseUrl: String) extends OAuthService {
Right(ProviderUserInfo(sub, email, "", username))
}
}.toEither.left.map(e => s"Failed to parse Apple id_token: ${e.getMessage}").flatten
}.toEither.fold(e => Left(s"Failed to parse Apple id_token: ${e.getMessage}"), identity)
}
@@ -174,7 +174,7 @@ case class ClientTextStoreImpl(
id: ClientTextId,
addedFactionIds: Vector[FactionId]
): ClientTextStore = {
val originalFactionIds = accessibleTo.getOrElse(id, Vector()).sorted
val originalFactionIds = accessibleTo.getOrElse(id, Vector.empty).sorted
val updatedFactionIds =
(originalFactionIds ++ addedFactionIds).distinct.sorted
@@ -400,7 +400,7 @@ object ClientTextStoreImpl {
.recover {
case _: FileNotFoundException =>
println("No complete text store found")
Vector()
Vector.empty
}
private def loadedIncompleteTexts(
@@ -447,12 +447,12 @@ object ClientTextStoreImpl {
}.toVector
)
}
.getOrElse((Vector(), Vector()))
.getOrElse((Vector.empty, Vector.empty))
}
.recover {
case _: FileNotFoundException =>
println("No incomplete text store found")
(Vector(), Vector())
(Vector.empty, Vector.empty)
}
private def loadedAccessibleTo(
@@ -483,7 +483,7 @@ object ClientTextStoreImpl {
.recover {
case _: FileNotFoundException =>
println("No accessibleTo store found")
Map()
Map.empty
case x => throw x
}
@@ -26,7 +26,7 @@ object TextGenerationResult {
}
}
go(Seq(), results)
go(Seq.empty, results)
}
}
@@ -331,7 +331,7 @@ object ChronicleEventGenerator {
)
}
case _ => Vector()
case _ => Vector.empty
}
def eventTextEntries(
@@ -191,12 +191,12 @@ case class EndPlayerCommandsPhaseAction(
case _: DeferredChange.EpidemicStarted =>
province.activeEvents :+ EpidemicEvent(startDate = currentDate)
case _: DeferredChange.PrisonerMoved => Vector()
case _: DeferredChange.PrisonerReturned => Vector()
case _: DeferredChange.CapturedHeroImprisoned => Vector()
case _: DeferredChange.CapturedHeroExecuted => Vector()
case _: DeferredChange.CapturedHeroExiled => Vector()
case _: DeferredChange.CapturedHeroReturned => Vector()
case _: DeferredChange.PrisonerMoved => Vector.empty
case _: DeferredChange.PrisonerReturned => Vector.empty
case _: DeferredChange.CapturedHeroImprisoned => Vector.empty
case _: DeferredChange.CapturedHeroExecuted => Vector.empty
case _: DeferredChange.CapturedHeroExiled => Vector.empty
case _: DeferredChange.CapturedHeroReturned => Vector.empty
}
),
removedDeferredChangeIndex = Some(0)
@@ -25,7 +25,7 @@ case class EndProvinceMoveResolutionPhaseAction(
factions = factions,
provinces = provinces,
heroes = heroes,
killedHeroIds = Vector()
killedHeroIds = Vector.empty
).randomResults(functionalRandom)
.map(
_ :+
@@ -221,7 +221,7 @@ case class HeroStatGainAction(
val llmRequest = LlmRequestT.ProfessionGainedMessage(
requestId = s"profession_gained_$heroId",
eagleGameId = gameId,
recipientFactionIds = Vector(), // all factions
recipientFactionIds = Vector.empty, // all factions
heroId = heroId,
factionId = factionId.getOrElse(0),
newProfession = profession
@@ -233,7 +233,7 @@ case class HeroStatGainAction(
factionId = factionId.getOrElse(0),
newProfession = profession
),
targetFactionIds = Vector(), // all factions
targetFactionIds = Vector.empty, // all factions
affectedHeroIds = Vector(heroId),
llm = NotificationT.Llm.Id(llmRequest.requestId),
deferred = true
@@ -140,7 +140,7 @@ case class NewRoundAction(
chronicler_style = chroniclerStyle
)
)
else Vector()
else Vector.empty
private def dateBefore(a: Date, b: Date): Boolean =
a.year < b.year || (a.year == b.year && a.month.value < b.month.value)
@@ -267,7 +267,7 @@ case class PerformUnaffiliatedHeroesAction(
toCheck = gs.provinces.keys,
nextHid = gs.heroes.values.map(_.id).max + 1,
currentGenerator = heroGenerator,
acc = RandomState(Vector(), fr)
acc = RandomState(Vector.empty, fr)
)
}
@@ -464,7 +464,7 @@ case class PerformUnaffiliatedHeroesAction(
toCheck = gs.provinces.keys,
nextHid = gs.heroes.values.map(_.id).max + 1,
currentGenerator = heroGenerator,
acc = RandomState(Vector(), fr)
acc = RandomState(Vector.empty, fr)
)
}
@@ -528,17 +528,17 @@ case class PerformUnaffiliatedHeroesAction(
gs.heroes
)
if spawnChance <= 0 then RandomState((Vector(), nextHid), fr)
if spawnChance <= 0 then RandomState((Vector.empty, nextHid), fr)
else
fr.nextDouble.continue {
case (roll, nextFr) =>
if roll >= spawnChance then RandomState((Vector(), nextHid), nextFr)
if roll >= spawnChance then RandomState((Vector.empty, nextHid), nextFr)
else {
// Find provinces containing faction leaders (faction head or sworn brothers)
val faction = gs.factions(factionId)
val leaderProvinces = FactionUtils.provincesWithLeaders(gs.provinces.values, faction)
if leaderProvinces.isEmpty then RandomState((Vector(), nextHid), nextFr)
if leaderProvinces.isEmpty then RandomState((Vector.empty, nextHid), nextFr)
else
nextFr.nextRandomElement(leaderProvinces.map(_.id)).continue {
case (targetPid, fr2) =>

Some files were not shown because too many files have changed in this diff Show More