载入中...
搜索中...
未找到
RTS.h
浏览该文件的文档.
63class EVENGINE_API_DOMAINS RTS : public Module, public IGameplayControlProvider, public IGameplayInstanceCatalog {
119 [[nodiscard]] Result<ResourceNode*> newResourceNode(SubjectRef subject, std::string resourceType,
178 [[nodiscard]] Result<FanOutReceipt> fanOut(Player::Selection& selection, const CommandSpec& command,
256 [[nodiscard]] Result<void> setUnitAttribute(Unit& unit, std::string_view attribute, double value) const;
258 [[nodiscard]] Result<effects::EffectHandle> applyEffect(Unit& unit, const RTSEffectDefinition& definition) const;
299 [[nodiscard]] Result<ContentImportReceipt> loadContent(definitions::DefinitionRegistry& registry,
306 void setDefinitionRegistry(definitions::DefinitionRegistry* registry) noexcept { definitions_ = registry; }
320 void setCombatProviders(sensing::SensingWorld* sensing, combat::DamageRuntime* damage) noexcept;
327 [[nodiscard]] Result<void> configureSettlementRules(const settlement::SettlementRuleSet& rules);
337 void setAIProductionRequest(AIProductionRequest request) { aiProductionRequest_ = std::move(request); }
339 void setMatchResourceQuery(MatchResourceQuery query) { matchResourceQuery_ = std::move(query); }
341 void setPassiveIncomeCredit(PassiveIncomeCredit credit) { passiveIncomeCredit_ = std::move(credit); }
353 void setReinforcementCancel(ReinforcementCancel cancel) { reinforcementCancel_ = std::move(cancel); }
361 [[nodiscard]] Result<std::size_t> step(const SimulationStep& step, IRTSActionExecutor& executor);
384 [[nodiscard]] Result<void> addScriptResource(Faction& faction, std::string resource, std::int64_t amount);
386 [[nodiscard]] Result<std::int64_t> scriptResource(Faction& faction, std::string_view resource) const;
406 [[nodiscard]] Result<RTSBuildReceipt> queueScriptUnit(Building& producer, SubjectRef unitSubject,
412 [[nodiscard]] Result<Building*> startScriptConstruction(Faction& faction, SubjectRef buildingSubject,
420 [[nodiscard]] Result<RTSBuildReceipt> queueScriptResearch(Building& producer, std::string upgrade,
433 [[nodiscard]] Result<void> setReinforcementLimit(Building& producer, std::size_t maximum) const;
460 [[nodiscard]] Result<std::size_t> unloadTransport(Unit& transport, WorldPosition destination) const;
462 [[nodiscard]] Result<std::size_t> evacuateBuilding(Building& building, WorldPosition destination) const;
470 [[nodiscard]] Result<void> importScriptCommandLog(std::string_view text, bool clearExisting = true);
534 [[nodiscard]] Result<std::vector<MovementGroup>> prepareMovementGroups(const RTSStateSnapshot& snapshot) const;
551 [[nodiscard]] Result<ProductionSpawnOutcome> placeProducedUnit(Unit& unit, WorldPosition requested);
Host-neutral player-equivalent command and observation protocol.
Optional companion surface for gameplay providers that can enumerate instances.
Canonical definition-to-RTS-component materialization.
Selective combat-stat adapter for RTS units.
Atomic RTS content-pack import into the canonical definition registry.
RTS effect adapter with morale, suppression and production policies.
Deterministic match lifecycle and victory systems.
Atomic RTS build/production composition over the shared protocols.
Stable tick-addressed RTS command recording and replay.
Stable in-memory RTS root snapshots independent of ECS handles.
Deterministic phase-one RTS systems and their ECS contracts.
Research settlement over canonical Definitions and Production.
Versioned, integrity-checked persistence envelopes.
Multi-provider gameplay boundary consumed by input, scripts and automation.
Definition GameplayControl.h:90
Optional read-only discovery surface implemented beside a gameplay provider.
Definition GameplayInstanceCatalog.h:32
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
Deterministic registry of topic-neutral, versioned JSON definitions.
Definition Definitions.h:58
Pathfinding facade. Single-agent: A*. Group (same goal): Flow Field + follow. Grid/topology internals...
Definition Pathfinder.h:20
RTS building domain root with placement and production composition.
Definition RTSTypes.h:840
Faction domain root; membership is a set of typed runtime handles.
Definition RTSTypes.h:1178
Interface isolating RTS orders from the shared action runtime.
Definition RTSAction.h:38
void setRepairDebit(RepairDebit debit)
Install the game-owned economy debit boundary used by building repair.
Definition RTS.h:311
void setFireLineQuery(FireLineQuery query)
Install the map/game-owned line-of-fire query used by direct weapons.
Definition RTS.h:329
void setProductionSpawnPosition(ProductionSpawnPosition position)
Install the game/map-owned deterministic building-exit placement probe.
Definition RTS.h:349
void setMatchResourceQuery(MatchResourceQuery query)
Install the authoritative economy query used by resource-target matches.
Definition RTS.h:339
Result< ContentImportReceipt > loadContent(definitions::DefinitionRegistry ®istry, std::string_view json)
Atomically import an RTS content pack into the caller-owned canonical definition registry.
Definition RTS.h:299
void setAIProductionRequest(AIProductionRequest request)
Install the authoritative production boundary used by enabled faction AI policies.
Definition RTS.h:337
void setAmmoProductionPurchase(AmmoProductionPurchase purchase)
Install the authoritative economy purchase boundary used by building ammunition production.
Definition RTS.h:343
void setDefinitionRegistry(definitions::DefinitionRegistry *registry) noexcept
Attach the canonical definition registry used to settle completed research.
Definition RTS.h:306
void setCombatHeightQuery(CombatHeightQuery query)
Install the map/game-owned absolute projectile launch-height query.
Definition RTS.h:331
void setPassiveIncomeCredit(PassiveIncomeCredit credit)
Install the authoritative economy credit boundary used by powered passive income.
Definition RTS.h:341
void setProductionSpawn(ProductionSpawn spawn)
Install the game-owned factory that materializes completed canonical unit production tasks.
Definition RTS.h:347
void setReinforcementCancel(ReinforcementCancel cancel)
Install the game-owned atomic cancellation/refund boundary for capped reinforcements.
Definition RTS.h:353
void setResourceCredit(ResourceCredit credit)
Install the game-owned economy credit boundary used by mining deliveries.
Definition RTS.h:309
void setProjectileCollisionQuery(ProjectileCollisionQuery query)
Install the map/physics-owned swept collision query for in-flight projectiles.
Definition RTS.h:333
Module_REG(RTS)
@ Building
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:26
Definition RTS.cpp:24
DamageChannel
Authoritative damage route that produced one transient RTS frame event.
Definition RTSSystems.h:67
@ Weapon
std::function< Result< double >(Faction &, std::string_view)> MatchResourceQuery
Reads a resource balance from the game-owned canonical economy account.
Definition RTSMatch.h:16
std::function< map::Fov *(Faction &)> FogProvider
Resolves the canonical FOV instance used by a faction; allies may deliberately share one instance.
Definition RTSSystems.h:310
std::function< Result< resource::Receipt >(Building &, const resource::CostSpec &)> PassiveIncomeCredit
Credits passive building income through the game-owned canonical economy boundary.
Definition RTSSystems.h:402
std::function< Result< resource::Receipt >(Unit &, const resource::CostSpec &)> ResourceCredit
Callback that credits gathered resources to the authoritative account selected by the game.
Definition RTSSystems.h:358
std::function< Result< ProductionSpawnOutcome >(Building &, const production::ProductionTask &, WorldPosition)> ProductionSpawn
Game-owned factory receiving the requested production exit position. The factory owns final placement...
Definition RTSSystems.h:729
std::function< Result< std::optional< WorldPosition > >(Building &, const production::ProductionTask &)> ProductionSpawnPosition
Game/map-owned deterministic exit probe; empty means every valid exit is currently occupied.
Definition RTSSystems.h:732
std::function< Result< std::optional< ProjectileCollision > >(WorldPosition from, float fromHeight, WorldPosition to, float toHeight, SubjectRef source, ecs::EntityHandle intendedTarget)> ProjectileCollisionQuery
Map/physics-owned swept collision query; empty means the segment remained clear.
Definition RTSSystems.h:620
std::function< void(Unit &, const OrderRecord &)> NavigationEvent
Notification emitted once when a newly planned order has no canonical map route.
Definition RTSSystems.h:270
std::function< Result< void >(Faction &, Building &, const LogicalId &)> AIProductionRequest
Authoritative production boundary invoked by AI policy decisions.
Definition RTSSystems.h:571
std::function< Result< bool >(WorldPosition origin, WorldPosition target, ecs::EntityHandle source, ecs::EntityHandle targetEntity, const weapon::WeaponDefinition &weapon)> FireLineQuery
Uses canonical sensing, weapon and damage providers for RTS automatic fire.
Definition RTSSystems.h:584
std::function< CombatHeightProfile(WorldPosition origin, WorldPosition target, ecs::EntityHandle source, ecs::EntityHandle targetEntity)> CombatHeightQuery
Resolve absolute heights for one authorized projectile launch.
Definition RTSSystems.h:589
std::function< Result< resource::Receipt >(Unit &, Building &, const resource::CostSpec &)> RepairDebit
Callback that debits repair costs from the authoritative account selected by the game.
Definition RTSSystems.h:383
std::function< Result< std::size_t >(Building &, std::string_view, std::int64_t, std::size_t)> AmmoProductionPurchase
Assigns and transfers tactical ammunition through canonical WeaponEntity resource state.
Definition RTSSystems.h:425
std::function< Result< void >(Building &, std::string_view)> ReinforcementCancel
Pauses canonical production tasks when a shared rally combat group reaches reinforcement limits.
Definition RTSSystems.h:744
Definition Container.h:602
One discoverable domain action and its owning schema projection.
Definition GameplayControl.h:37
Owning evidence that a gameplay authority accepted one command.
Definition GameplayControl.h:62
One player-semantic command submitted to a domain authority.
Definition GameplayControl.h:52
Owning event projection safe across frames and process boundaries.
Definition GameplayControl.h:71
Immutable owning observation of one authoritative gameplay instance.
Definition GameplayControl.h:43
Owning authorization context shared by player, script and automation adapters.
Definition GameplayControl.h:30
Complete owning audit result of one committed damage transaction.
Definition Damage.h:98
Stable presentation payload for firing, launch, and miss feedback.
Definition RTSSystems.h:84
One domain-neutral command submitted to a unit's generic order queue.
Definition RTSTypes.h:101
Stable payload for one committed RTS lifecycle transition.
Definition RTSSystems.h:119
Owning transient projection of one committed canonical weapon lifecycle event.
Definition RTS.h:43
Owning transient projection of one canonical damage transaction completed this RTS frame.
Definition RTS.h:34
Owning transient projection of one committed non-combat RTS lifecycle event.
Definition RTS.h:50
Stable pacing-group membership; entity handles and derived speed factors are excluded....
Definition RTSSnapshot.h:158
One process-independent command using stable subjects instead of ECS handles.
Definition RTSReplay.h:39