Prefix all getters with "get"
This commit is contained in:
@@ -86,7 +86,7 @@ struct Building
|
||||
// Total items held on the output side: buffered plus still-emerging. The
|
||||
// output-buffer capacity rule (REQ-MAT-OUTPUT-BUFFER) counts emerging items,
|
||||
// since they have not yet left the building.
|
||||
int outputItemCount() const
|
||||
int getOutputItemCount() const
|
||||
{
|
||||
int count = static_cast<int>(outputBuffer.items.size());
|
||||
for (const std::vector<BeltItemSlot>& lane : emergingItems)
|
||||
|
||||
@@ -26,15 +26,15 @@ struct SelectedBuilding
|
||||
// (the HQ and defence stations, per REQ-UI-BLUEPRINT-CREATE).
|
||||
std::optional<SelectedBuilding> resolvePlaceable(const Simulation& sim, BuildingId id)
|
||||
{
|
||||
const Building* building = sim.buildings().findBuilding(id);
|
||||
const ConstructionSite* site = building ? nullptr : sim.buildings().findSite(id);
|
||||
const Building* building = sim.getBuildings().findBuilding(id);
|
||||
const ConstructionSite* site = building ? nullptr : sim.getBuildings().findSite(id);
|
||||
if (!building && !site)
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const BuildingType type = building ? building->type : site->type;
|
||||
const BuildingDef* def = sim.config().buildings.findBuildingDef(type);
|
||||
const BuildingDef* def = sim.getConfig().buildings.findBuildingDef(type);
|
||||
if (!def || !def->playerPlaceable)
|
||||
{
|
||||
return std::nullopt;
|
||||
@@ -52,8 +52,8 @@ std::optional<SelectedBuilding> resolvePlaceable(const Simulation& sim, Building
|
||||
|
||||
std::optional<BuildingConfig> readBuildingConfig(const Simulation& sim, BuildingId id)
|
||||
{
|
||||
const Building* building = sim.buildings().findBuilding(id);
|
||||
const ConstructionSite* site = building ? nullptr : sim.buildings().findSite(id);
|
||||
const Building* building = sim.getBuildings().findBuilding(id);
|
||||
const ConstructionSite* site = building ? nullptr : sim.getBuildings().findSite(id);
|
||||
if (!building && !site)
|
||||
{
|
||||
return std::nullopt;
|
||||
@@ -77,7 +77,7 @@ std::optional<BuildingConfig> readBuildingConfig(const Simulation& sim, Building
|
||||
{
|
||||
// Operational splitter filters live in the BeltSystem, keyed by tile.
|
||||
const std::optional<BeltSystem::SplitterInfo> info =
|
||||
sim.belts().getSplitterInfo(building->anchor);
|
||||
sim.getBelts().getSplitterInfo(building->anchor);
|
||||
if (info.has_value())
|
||||
{
|
||||
config.splitterFilterA = info->filterA;
|
||||
|
||||
@@ -1014,7 +1014,7 @@ void BuildingSystem::tickProduction(Tick currentTick)
|
||||
|
||||
// 3. Output buffer has space for chosen outputs? Emerging items still
|
||||
// count against the buffer (REQ-MAT-OUTPUT-EMERGE).
|
||||
const int newSize = building.outputItemCount()
|
||||
const int newSize = building.getOutputItemCount()
|
||||
+ static_cast<int>(chosen.size());
|
||||
if (newSize > building.outputBuffer.capacity)
|
||||
{
|
||||
@@ -1279,12 +1279,12 @@ const ConstructionSite* BuildingSystem::findSite(BuildingId id) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<Building> BuildingSystem::allBuildings() const
|
||||
std::vector<Building> BuildingSystem::getAllBuildings() const
|
||||
{
|
||||
return m_buildings;
|
||||
}
|
||||
|
||||
std::vector<ConstructionSite> BuildingSystem::allSites() const
|
||||
std::vector<ConstructionSite> BuildingSystem::getAllSites() const
|
||||
{
|
||||
return std::vector<ConstructionSite>(m_constructionQueue.begin(),
|
||||
m_constructionQueue.end());
|
||||
@@ -1308,7 +1308,7 @@ bool isProductionBuildingType(BuildingType type)
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int BuildingSystem::productionBuildingCount() const
|
||||
int BuildingSystem::getProductionBuildingCount() const
|
||||
{
|
||||
int count = 0;
|
||||
for (const Building& b : m_buildings)
|
||||
@@ -1318,7 +1318,7 @@ int BuildingSystem::productionBuildingCount() const
|
||||
return count;
|
||||
}
|
||||
|
||||
int BuildingSystem::activeProductionBuildingCount() const
|
||||
int BuildingSystem::getActiveProductionBuildingCount() const
|
||||
{
|
||||
int count = 0;
|
||||
for (const Building& b : m_buildings)
|
||||
@@ -1328,7 +1328,7 @@ int BuildingSystem::activeProductionBuildingCount() const
|
||||
return count;
|
||||
}
|
||||
|
||||
std::vector<BuildingSystem::BeltTileInfo> BuildingSystem::allBeltTiles() const
|
||||
std::vector<BuildingSystem::BeltTileInfo> BuildingSystem::getAllBeltTiles() const
|
||||
{
|
||||
std::vector<BeltTileInfo> result;
|
||||
for (const Building& b : m_buildings)
|
||||
@@ -1518,7 +1518,7 @@ bool BuildingSystem::deliverScrapToSalvageBay(BuildingId bayId)
|
||||
}
|
||||
// Emerging scrap still counts against the bay's holding capacity
|
||||
// (REQ-MAT-OUTPUT-EMERGE).
|
||||
if (bay->outputItemCount() >= bay->outputBuffer.capacity)
|
||||
if (bay->getOutputItemCount() >= bay->outputBuffer.capacity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -112,17 +112,17 @@ public:
|
||||
|
||||
const Building* findBuilding(BuildingId id) const;
|
||||
const ConstructionSite* findSite(BuildingId id) const;
|
||||
std::vector<Building> allBuildings() const;
|
||||
std::vector<ConstructionSite> allSites() const;
|
||||
std::vector<Building> getAllBuildings() const;
|
||||
std::vector<ConstructionSite> getAllSites() const;
|
||||
|
||||
// REQ-UI-DEBUG-OVERLAY "Max Factory Production": count of completed
|
||||
// (operational) Miner/Smelter/Assembler/ReprocessingPlant/Shipyard buildings.
|
||||
int productionBuildingCount() const;
|
||||
int getProductionBuildingCount() const;
|
||||
|
||||
// REQ-UI-DEBUG-OVERLAY "Current Factory Production": subset of the above
|
||||
// that currently has an active production cycle.
|
||||
int activeProductionBuildingCount() const;
|
||||
std::vector<BeltTileInfo> allBeltTiles() const;
|
||||
int getActiveProductionBuildingCount() const;
|
||||
std::vector<BeltTileInfo> getAllBeltTiles() const;
|
||||
bool isTileOccupied(QPoint tile) const;
|
||||
|
||||
// Visits every item currently emerging from a building output port on its
|
||||
|
||||
@@ -46,18 +46,18 @@ void CommandManager::drain()
|
||||
{
|
||||
// Restart is a file boundary: a fresh file with the new seed.
|
||||
m_recorder->startNewRun(m_simulation.getSeed(),
|
||||
m_simulation.rngFingerprint());
|
||||
m_simulation.getRngFingerprint());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Commands drain before the tick batch, so currentTick is the count of
|
||||
// completed ticks the command is pinned to.
|
||||
const Tick tick = m_simulation.currentTick();
|
||||
const Tick tick = m_simulation.getCurrentTick();
|
||||
m_simulation.apply(*command);
|
||||
if (m_recorder)
|
||||
{
|
||||
m_recorder->recordCommand(tick, *command, m_simulation.rngFingerprint());
|
||||
m_recorder->recordCommand(tick, *command, m_simulation.getRngFingerprint());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ void CommandManager::setRecorder(std::unique_ptr<ReplayRecorder> recorder)
|
||||
m_recorder = std::move(recorder);
|
||||
if (m_recorder)
|
||||
{
|
||||
m_recorder->startNewRun(m_simulation.getSeed(), m_simulation.rngFingerprint());
|
||||
m_recorder->startNewRun(m_simulation.getSeed(), m_simulation.getRngFingerprint());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ void CommandManager::setReplayMode(bool replayMode)
|
||||
|
||||
void CommandManager::recordTickCheckpoint()
|
||||
{
|
||||
if (m_recorder && (m_simulation.currentTick() % kChecksumIntervalTicks == 0))
|
||||
if (m_recorder && (m_simulation.getCurrentTick() % kChecksumIntervalTicks == 0))
|
||||
{
|
||||
m_recorder->recordChecksum(m_simulation.currentTick(), m_simulation.rngFingerprint());
|
||||
m_recorder->recordChecksum(m_simulation.getCurrentTick(), m_simulation.getRngFingerprint());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ void ReplayPlayer::processEntriesAt(Tick tick)
|
||||
{
|
||||
m_simulation.apply(*entry.command);
|
||||
}
|
||||
else if (m_simulation.rngFingerprint() != entry.fingerprint)
|
||||
else if (m_simulation.getRngFingerprint() != entry.fingerprint)
|
||||
{
|
||||
m_desyncTick = tick;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class Simulation;
|
||||
// each frame, for each tick to run:
|
||||
// if (player.isFinished()) break;
|
||||
// sim.tick();
|
||||
// player.advanceTo(sim.currentTick());
|
||||
// player.advanceTo(sim.getCurrentTick());
|
||||
class ReplayPlayer
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -58,7 +58,7 @@ std::string computeReplayConfigHash(const std::string& configDir)
|
||||
hasher.appendBytes(bytes.constData(), static_cast<std::size_t>(bytes.size()));
|
||||
}
|
||||
}
|
||||
return toHex(hasher.value());
|
||||
return toHex(hasher.getValue());
|
||||
}
|
||||
|
||||
void ReplayRecorder::startNewRun(unsigned int seed, std::uint64_t initialRngFingerprint)
|
||||
@@ -124,7 +124,7 @@ bool ReplayRecorder::isOpen() const
|
||||
return m_stream.is_open();
|
||||
}
|
||||
|
||||
const std::string& ReplayRecorder::currentFilePath() const
|
||||
const std::string& ReplayRecorder::getCurrentFilePath() const
|
||||
{
|
||||
return m_filePath;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
void close();
|
||||
bool isOpen() const;
|
||||
const std::string& currentFilePath() const;
|
||||
const std::string& getCurrentFilePath() const;
|
||||
|
||||
private:
|
||||
std::string m_configDir;
|
||||
|
||||
@@ -113,7 +113,7 @@ Simulation::~Simulation()
|
||||
unregisterForEvents();
|
||||
}
|
||||
|
||||
const GameConfig& Simulation::config() const
|
||||
const GameConfig& Simulation::getConfig() const
|
||||
{
|
||||
return m_config;
|
||||
}
|
||||
@@ -579,7 +579,7 @@ void Simulation::tickDeathsAndLoot()
|
||||
}
|
||||
else
|
||||
{
|
||||
const double genD = static_cast<double>(m_waveSystem->generation());
|
||||
const double genD = static_cast<double>(m_waveSystem->getGeneration());
|
||||
scrap = static_cast<int>(
|
||||
m_config.stations.enemyStation.scrapDropFormula.evaluate(genD));
|
||||
}
|
||||
@@ -619,9 +619,9 @@ void Simulation::tickDeathsAndLoot()
|
||||
if (es0Gone && es1Gone &&
|
||||
m_currentEnemyStationEntities[0] != entt::null)
|
||||
{
|
||||
const int destroyedLevel = m_waveSystem->generation();
|
||||
const int destroyedLevel = m_waveSystem->getGeneration();
|
||||
m_waveSystem->onEnemyStationsDestroyed();
|
||||
placeEnemyStationSet(m_waveSystem->generation());
|
||||
placeEnemyStationSet(m_waveSystem->getGeneration());
|
||||
generateSchematicChoices(destroyedLevel);
|
||||
}
|
||||
}
|
||||
@@ -968,7 +968,7 @@ void Simulation::appendStringSet(Hasher& hasher, const std::set<std::string>& id
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long long Simulation::rngFingerprint() const
|
||||
unsigned long long Simulation::getRngFingerprint() const
|
||||
{
|
||||
return fingerprintRng(m_rng);
|
||||
}
|
||||
@@ -991,11 +991,11 @@ unsigned long long Simulation::computeStateChecksum() const
|
||||
hasher.append(m_expansionsPurchased);
|
||||
|
||||
// WaveSystem scalar state, reached through existing accessors.
|
||||
hasher.append(threatLevel());
|
||||
hasher.append(threatAccumulationRate());
|
||||
hasher.append(bossWaveCounter());
|
||||
hasher.append(bossCountdownTicks());
|
||||
hasher.append(normalGapRemainingTicks());
|
||||
hasher.append(getThreatLevel());
|
||||
hasher.append(getThreatAccumulationRate());
|
||||
hasher.append(getBossWaveCounter());
|
||||
hasher.append(getBossCountdownTicks());
|
||||
hasher.append(getNormalGapRemainingTicks());
|
||||
|
||||
// Schematic / unlock state (std::map and std::set iterate in sorted order).
|
||||
appendSchematicMap(hasher, m_schematicLevels);
|
||||
@@ -1052,7 +1052,7 @@ unsigned long long Simulation::computeStateChecksum() const
|
||||
hasher.append(c.schematicId);
|
||||
});
|
||||
|
||||
return hasher.value();
|
||||
return hasher.getValue();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -1081,7 +1081,7 @@ bool Simulation::hasSchematicChoicesPending() const
|
||||
// Accessors
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Tick Simulation::currentTick() const
|
||||
Tick Simulation::getCurrentTick() const
|
||||
{
|
||||
return m_currentTick;
|
||||
}
|
||||
@@ -1091,18 +1091,18 @@ unsigned int Simulation::getSeed() const
|
||||
return m_seed;
|
||||
}
|
||||
|
||||
int Simulation::buildingBlocksStock() const
|
||||
int Simulation::getBuildingBlocksStock() const
|
||||
{
|
||||
return m_buildingBlocksStock;
|
||||
}
|
||||
|
||||
int Simulation::currentAsteroidWidth_tiles() const
|
||||
int Simulation::getCurrentAsteroidWidth_tiles() const
|
||||
{
|
||||
return m_config.world.regions.asteroidWidth_tiles
|
||||
+ m_expansionsPurchased * m_config.world.expansion.columnsPerExpansion_tiles;
|
||||
}
|
||||
|
||||
int Simulation::currentExpansionCost() const
|
||||
int Simulation::getCurrentExpansionCost() const
|
||||
{
|
||||
const double cost = m_config.world.expansion.costBuildingBlocksFormula.evaluate(
|
||||
static_cast<double>(m_expansionsPurchased));
|
||||
@@ -1111,14 +1111,14 @@ int Simulation::currentExpansionCost() const
|
||||
|
||||
void Simulation::tryExpandAsteroid()
|
||||
{
|
||||
const int cost = currentExpansionCost();
|
||||
const int cost = getCurrentExpansionCost();
|
||||
if (m_buildingBlocksStock < cost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_buildingBlocksStock -= cost;
|
||||
++m_expansionsPurchased;
|
||||
m_buildingSystem->setAsteroidWidth_tiles(currentAsteroidWidth_tiles());
|
||||
m_buildingSystem->setAsteroidWidth_tiles(getCurrentAsteroidWidth_tiles());
|
||||
}
|
||||
|
||||
bool Simulation::isGameOver() const
|
||||
@@ -1131,44 +1131,44 @@ bool Simulation::isWon() const
|
||||
return m_isWon;
|
||||
}
|
||||
|
||||
int Simulation::artifactCount() const
|
||||
int Simulation::getArtifactCount() const
|
||||
{
|
||||
return m_artifactCount;
|
||||
}
|
||||
|
||||
double Simulation::threatLevel() const
|
||||
double Simulation::getThreatLevel() const
|
||||
{
|
||||
return m_waveSystem->threatLevel();
|
||||
return m_waveSystem->getThreatLevel();
|
||||
}
|
||||
|
||||
double Simulation::threatAccumulationRate() const
|
||||
double Simulation::getThreatAccumulationRate() const
|
||||
{
|
||||
return m_waveSystem->threatAccumulationRate();
|
||||
return m_waveSystem->getThreatAccumulationRate();
|
||||
}
|
||||
|
||||
double Simulation::maxFactoryProductionThreatRate() const
|
||||
double Simulation::getMaxFactoryProductionThreatRate() const
|
||||
{
|
||||
return static_cast<double>(m_buildingSystem->productionBuildingCount());
|
||||
return static_cast<double>(m_buildingSystem->getProductionBuildingCount());
|
||||
}
|
||||
|
||||
double Simulation::currentFactoryProductionThreatRate() const
|
||||
double Simulation::getCurrentFactoryProductionThreatRate() const
|
||||
{
|
||||
return static_cast<double>(m_buildingSystem->activeProductionBuildingCount());
|
||||
return static_cast<double>(m_buildingSystem->getActiveProductionBuildingCount());
|
||||
}
|
||||
|
||||
int Simulation::bossWaveCounter() const
|
||||
int Simulation::getBossWaveCounter() const
|
||||
{
|
||||
return m_waveSystem->bossWaveCounter();
|
||||
return m_waveSystem->getBossWaveCounter();
|
||||
}
|
||||
|
||||
Tick Simulation::bossCountdownTicks() const
|
||||
Tick Simulation::getBossCountdownTicks() const
|
||||
{
|
||||
return m_waveSystem->bossCountdownTicks();
|
||||
return m_waveSystem->getBossCountdownTicks();
|
||||
}
|
||||
|
||||
Tick Simulation::normalGapRemainingTicks() const
|
||||
Tick Simulation::getNormalGapRemainingTicks() const
|
||||
{
|
||||
return m_waveSystem->normalGapRemainingTicks();
|
||||
return m_waveSystem->getNormalGapRemainingTicks();
|
||||
}
|
||||
|
||||
bool Simulation::isSchematicUnlocked(const std::string& shipId) const
|
||||
@@ -1222,52 +1222,52 @@ void Simulation::demolish(BuildingId id)
|
||||
m_buildingBlocksStock += m_buildingSystem->demolish(id);
|
||||
}
|
||||
|
||||
BuildingSystem& Simulation::buildingsMutable()
|
||||
BuildingSystem& Simulation::getBuildingsMutable()
|
||||
{
|
||||
return *m_buildingSystem;
|
||||
}
|
||||
|
||||
const BuildingSystem& Simulation::buildings() const
|
||||
const BuildingSystem& Simulation::getBuildings() const
|
||||
{
|
||||
return *m_buildingSystem;
|
||||
}
|
||||
|
||||
BeltSystem& Simulation::beltsMutable()
|
||||
BeltSystem& Simulation::getBeltsMutable()
|
||||
{
|
||||
return m_beltSystem;
|
||||
}
|
||||
|
||||
const BeltSystem& Simulation::belts() const
|
||||
const BeltSystem& Simulation::getBelts() const
|
||||
{
|
||||
return m_beltSystem;
|
||||
}
|
||||
|
||||
ShipSystem& Simulation::ships()
|
||||
ShipSystem& Simulation::getShips()
|
||||
{
|
||||
return *m_shipSystem;
|
||||
}
|
||||
|
||||
const ShipSystem& Simulation::ships() const
|
||||
const ShipSystem& Simulation::getShips() const
|
||||
{
|
||||
return *m_shipSystem;
|
||||
}
|
||||
|
||||
ScrapSystem& Simulation::scraps()
|
||||
ScrapSystem& Simulation::getScraps()
|
||||
{
|
||||
return *m_scrapSystem;
|
||||
}
|
||||
|
||||
const ScrapSystem& Simulation::scraps() const
|
||||
const ScrapSystem& Simulation::getScraps() const
|
||||
{
|
||||
return *m_scrapSystem;
|
||||
}
|
||||
|
||||
EntityAdmin& Simulation::admin()
|
||||
EntityAdmin& Simulation::getAdmin()
|
||||
{
|
||||
return m_admin;
|
||||
}
|
||||
|
||||
const EntityAdmin& Simulation::admin() const
|
||||
const EntityAdmin& Simulation::getAdmin() const
|
||||
{
|
||||
return m_admin;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
explicit Simulation(GameConfig config, unsigned int seed = 0);
|
||||
~Simulation();
|
||||
|
||||
const GameConfig& config() const;
|
||||
const GameConfig& getConfig() const;
|
||||
|
||||
// Reinitializes all simulation state as if constructed fresh.
|
||||
void reset(unsigned int seed = 0);
|
||||
@@ -68,26 +68,26 @@ public:
|
||||
// Returns true if there are pending schematic choices waiting for player input.
|
||||
bool hasSchematicChoicesPending() const;
|
||||
|
||||
Tick currentTick() const;
|
||||
Tick getCurrentTick() const;
|
||||
// The seed this run was (re)initialized with; written to the replay header.
|
||||
unsigned int getSeed() const;
|
||||
int buildingBlocksStock() const;
|
||||
int getBuildingBlocksStock() const;
|
||||
// Current asteroid width in tiles = base width + purchased expansions
|
||||
// (REQ-EXP-UNLOCK, REQ-GW-ASTEROID-EXPAND).
|
||||
int currentAsteroidWidth_tiles() const;
|
||||
int getCurrentAsteroidWidth_tiles() const;
|
||||
// Building block cost of the next expansion, floored to an integer
|
||||
// (REQ-EXP-COST); x = number of expansions already purchased.
|
||||
int currentExpansionCost() const;
|
||||
int getCurrentExpansionCost() const;
|
||||
bool isGameOver() const;
|
||||
bool isWon() const;
|
||||
int artifactCount() const;
|
||||
double threatLevel() const;
|
||||
double threatAccumulationRate() const;
|
||||
double maxFactoryProductionThreatRate() const;
|
||||
double currentFactoryProductionThreatRate() const;
|
||||
int bossWaveCounter() const;
|
||||
Tick bossCountdownTicks() const;
|
||||
Tick normalGapRemainingTicks() const;
|
||||
int getArtifactCount() const;
|
||||
double getThreatLevel() const;
|
||||
double getThreatAccumulationRate() const;
|
||||
double getMaxFactoryProductionThreatRate() const;
|
||||
double getCurrentFactoryProductionThreatRate() const;
|
||||
int getBossWaveCounter() const;
|
||||
Tick getBossCountdownTicks() const;
|
||||
Tick getNormalGapRemainingTicks() const;
|
||||
|
||||
// Ship schematic state query.
|
||||
bool isSchematicUnlocked(const std::string& shipId) const;
|
||||
@@ -102,25 +102,25 @@ public:
|
||||
// -- Determinism (see docs/replay_design.md) -----------------------------
|
||||
// 64-bit fingerprint of the RNG stream state. Cheap; written to the replay
|
||||
// file periodically + after each command for desync detection.
|
||||
unsigned long long rngFingerprint() const;
|
||||
unsigned long long getRngFingerprint() const;
|
||||
|
||||
// 64-bit fingerprint of the full simulation state (RNG, scalars, buildings,
|
||||
// belts, and ECS component state). Used by the double-run determinism test;
|
||||
// a superset of rngFingerprint().
|
||||
// a superset of getRngFingerprint().
|
||||
unsigned long long computeStateChecksum() const;
|
||||
|
||||
// Const subsystem accessors (queries only). The mutable counterparts are
|
||||
// private and reachable only through Simulation::apply (the command
|
||||
// chokepoint) or, in tests, SimulationTestAccess — so production code cannot
|
||||
// mutate the factory outside the recorded command path (docs/replay_design.md).
|
||||
const BuildingSystem& buildings() const;
|
||||
const BeltSystem& belts() const;
|
||||
ShipSystem& ships();
|
||||
const ShipSystem& ships() const;
|
||||
ScrapSystem& scraps();
|
||||
const ScrapSystem& scraps() const;
|
||||
EntityAdmin& admin();
|
||||
const EntityAdmin& admin() const;
|
||||
const BuildingSystem& getBuildings() const;
|
||||
const BeltSystem& getBelts() const;
|
||||
ShipSystem& getShips();
|
||||
const ShipSystem& getShips() const;
|
||||
ScrapSystem& getScraps();
|
||||
const ScrapSystem& getScraps() const;
|
||||
EntityAdmin& getAdmin();
|
||||
const EntityAdmin& getAdmin() const;
|
||||
|
||||
private:
|
||||
// Grants tests access to the private player-action mutators below without
|
||||
@@ -148,8 +148,8 @@ private:
|
||||
void tryExpandAsteroid();
|
||||
|
||||
// Mutable subsystem accessors; same chokepoint rule as the mutators above.
|
||||
BuildingSystem& buildingsMutable();
|
||||
BeltSystem& beltsMutable();
|
||||
BuildingSystem& getBuildingsMutable();
|
||||
BeltSystem& getBeltsMutable();
|
||||
|
||||
void handleEvent(std::shared_ptr<const TracePrintRequestedEvent> event) override;
|
||||
|
||||
|
||||
@@ -57,5 +57,5 @@ std::uint64_t fingerprintRng(const std::mt19937& rng)
|
||||
stream << rng; // full internal state as space-separated integers
|
||||
Hasher hasher;
|
||||
hasher.append(stream.str());
|
||||
return hasher.value();
|
||||
return hasher.getValue();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
void append(const QVector2D& vector);
|
||||
void append(const std::string& text);
|
||||
|
||||
std::uint64_t value() const { return m_state; }
|
||||
std::uint64_t getValue() const { return m_state; }
|
||||
|
||||
private:
|
||||
std::uint64_t m_state = 14695981039346656037ull; // FNV-1a 64-bit offset basis
|
||||
|
||||
@@ -98,12 +98,12 @@ void WaveSystem::onEnemyStationsDestroyed()
|
||||
++m_generation;
|
||||
}
|
||||
|
||||
double WaveSystem::threatLevel() const
|
||||
double WaveSystem::getThreatLevel() const
|
||||
{
|
||||
return m_threatLevel;
|
||||
}
|
||||
|
||||
double WaveSystem::threatAccumulationRate() const
|
||||
double WaveSystem::getThreatAccumulationRate() const
|
||||
{
|
||||
if (isInQuietWindow())
|
||||
{
|
||||
@@ -113,22 +113,22 @@ double WaveSystem::threatAccumulationRate() const
|
||||
return std::max(0.0, m_config.world.waves.threatRateFormula.evaluate(x));
|
||||
}
|
||||
|
||||
int WaveSystem::generation() const
|
||||
int WaveSystem::getGeneration() const
|
||||
{
|
||||
return m_generation;
|
||||
}
|
||||
|
||||
int WaveSystem::bossWaveCounter() const
|
||||
int WaveSystem::getBossWaveCounter() const
|
||||
{
|
||||
return m_bossWaveCounter;
|
||||
}
|
||||
|
||||
Tick WaveSystem::bossCountdownTicks() const
|
||||
Tick WaveSystem::getBossCountdownTicks() const
|
||||
{
|
||||
return m_bossCountdownTicks;
|
||||
}
|
||||
|
||||
Tick WaveSystem::normalGapRemainingTicks() const
|
||||
Tick WaveSystem::getNormalGapRemainingTicks() const
|
||||
{
|
||||
return m_normalGapRemainingTicks;
|
||||
}
|
||||
|
||||
@@ -34,26 +34,26 @@ public:
|
||||
// (REQ-WAV-BOSS-ADVANCE, REQ-PSH-STATION-STATS).
|
||||
void onEnemyStationsDestroyed();
|
||||
|
||||
double threatLevel() const;
|
||||
double getThreatLevel() const;
|
||||
|
||||
// Current rate at which threatLevel() is increasing, in threat/second
|
||||
// Current rate at which getThreatLevel() is increasing, in threat/second
|
||||
// (REQ-WAV-THREAT-RATE). 0 during a quiet window (REQ-WAV-QUIET) or when
|
||||
// the rate formula evaluates to a negative value.
|
||||
double threatAccumulationRate() const;
|
||||
double getThreatAccumulationRate() const;
|
||||
|
||||
// Current enemy-station generation level (0 for initial set,
|
||||
// incremented by 1 after each push — REQ-PSH-STATION-STATS).
|
||||
int generation() const;
|
||||
int getGeneration() const;
|
||||
|
||||
// Boss wave counter (REQ-WAV-BOSS-COUNTER): current cycle number, starts at 1.
|
||||
int bossWaveCounter() const;
|
||||
int getBossWaveCounter() const;
|
||||
|
||||
// Ticks remaining until the next boss wave fires (REQ-WAV-BOSS-COUNTDOWN).
|
||||
Tick bossCountdownTicks() const;
|
||||
Tick getBossCountdownTicks() const;
|
||||
|
||||
// Ticks remaining on the current normal-wave gap timer (REQ-WAV-GAP).
|
||||
// Frozen during quiet windows.
|
||||
Tick normalGapRemainingTicks() const;
|
||||
Tick getNormalGapRemainingTicks() const;
|
||||
|
||||
private:
|
||||
struct SpawnEntry
|
||||
|
||||
Reference in New Issue
Block a user