载入中...
搜索中...
未找到
RTSTypes.h
浏览该文件的文档.
189 Diagnostic::error(DiagnosticCode::StaleHandle, "RTS entity link target is not live", "link.handle"));
212 [[nodiscard]] bool isStale() const noexcept { return bound_ && ecs::try_get(handle_) == nullptr; }
367 [[nodiscard]] Result<void> initialize(std::span<const eve::attributes::AttributeSnapshotBase> values);
371 [[nodiscard]] Result<eve::attributes::ModifierId> addModifier(eve::attributes::AttributeModifier modifier);
454 [[nodiscard]] Result<std::string> enqueue(std::string_view owner, std::string_view kind, std::string_view product,
471 [[nodiscard]] Result<void> cancel(std::string_view taskId, std::string_view reason = "cancelled");
473 [[nodiscard]] std::vector<production::ProductionTask> readyToSettle(std::string_view kind) const;
505 ecs::EntityHandle self{};
571 std::size_t waypointIndex = 0;
627 std::uint64_t shotSequence = 0;
670 ecs::EntityHandle uplink{};
713 std::size_t convoyIndex = 0;
714 ecs::EntityHandle assignedTarget{};
715 ecs::EntityHandle convoyLeader{};
753 std::uint32_t shotSequence = 0;
755 ecs::EntityHandle fireSupportRequester{};
756 ecs::EntityHandle observedFireSpotter{};
761 std::uint64_t counterBatteryWindowTicks = 0;
850 ecs::EntityHandle self{};
924 ecs::EntityHandle capturingFaction{};
936 std::uint64_t combatGroup = 0;
937 ecs::EntityHandle transport{};
938 std::size_t minimumTransportLoad = 1;
944 std::size_t reinforcementLimit = 0;
960 ecs::EntityHandle airDefenseNetworkRoot{};
964 std::size_t airDefenseNetworkSize = 0;
969 std::uint64_t shotSequence = 0;
986 std::int64_t productionCostPerRound = 0;
1067 [[nodiscard]] static Building* createBuilding(SubjectRef subject = {}, LogicalId definition = {});
1129 ecs::EntityHandle self{};
1188 ecs::EntityHandle self{};
1229 std::size_t maxBuildersPerSite = 2;
1230 std::size_t maxRepairersPerBuilding = 2;
1231 std::size_t reserveWorkers = 0;
Owner-aware canonical attribute state shared by gameplay adapters.
Deterministic damage, poise, hit-reaction and knockback resolution.
Strong identity values shared by persistence, content and logical-name APIs.
RTS effect adapter with morale, suppression and production policies.
Move-only, checked operation results for the common layer.
Stable reference to a runtime gameplay subject.
Common time values and an injectable deterministic simulation clock.
std::map< std::string, std::span< const std::uint8_t > > members
Definition UnityPackage.cpp:81
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Canonical attributes component adapter, backed by attributes::AttributeSet.
Definition RTSTypes.h:323
AttributeComponent & operator=(AttributeComponent &&other) noexcept
Operator =.
AttributeComponent(AttributeComponent &&other) noexcept
Attribute component.
RTS building domain root with placement and production composition.
Definition RTSTypes.h:840
Validates a typed selection and fans one command out in formation order.
Definition RTSSystems.h:215
bool isBound() const noexcept
Whether a handle has been assigned, including a stale one.
Definition RTSTypes.h:210
ecs::Entity * resolve() const noexcept
Resolve the target for this call, or return null when stale.
Definition RTSTypes.h:214
static Result< EntityLink > bind(ecs::EntityHandle handle)
Bind a live ECS handle, rejecting a null or stale handle.
Definition RTSTypes.h:184
static EntityLink fromHandleForRestore(ecs::EntityHandle handle) noexcept
Rehydrate a serialized runtime link before its target is known.
Definition RTSTypes.h:202
bool isStale() const noexcept
Whether the assigned target no longer resolves at its generation.
Definition RTSTypes.h:212
const ecs::EntityHandle & handle() const noexcept
Return the local runtime handle retained by this link.
Definition RTSTypes.h:216
Faction domain root; membership is a set of typed runtime handles.
Definition RTSTypes.h:1178
Independent match composition root; factions may participate in different matches.
Definition RTSTypes.h:1295
Generic orders component adapter; the queue remains the sole order owner.
Definition RTSTypes.h:385
~OrderComponent()
Player domain root; selection is RTS-local, authority/economy/social are links.
Definition RTSTypes.h:1119
Production adapter whose queue owns all task state.
Definition RTSTypes.h:438
ProductionComponent(ProductionComponent &&other) noexcept
Production component.
ProductionComponent & operator=(ProductionComponent &&other) noexcept
Operator =.
Entity-local RTS effect component backed by the canonical adapter.
Definition RTSEffects.h:118
Coordinates Orders, Production, Action and resource payment.
Definition RTSProductionAction.h:113
Harvestable RTS resource node; deposited balances are owned by an external resource account.
Definition RTSTypes.h:1071
Strong key link to an external module-owned service object.
Definition RTSTypes.h:240
static ServiceLink fromKeyForRestore(std::string_view key)
Rehydrate a provider key during restore/import.
Definition RTSTypes.h:256
static Result< ServiceLink > bind(std::string_view key)
Bind a non-empty provider key.
Definition RTSTypes.h:243
bool isStale() const noexcept
Whether the key is empty and therefore cannot resolve.
Definition RTSTypes.h:265
Entity-local sorted tags; this is the RTS entity's tag authority.
Definition RTSTypes.h:153
const std::vector< std::string > & values() const noexcept
Return tags in deterministic order.
Definition RTSTypes.h:162
Definition QueueInspector.h:11
Definition QueueInspector.h:12
Definition RTS.cpp:24
const char * combatStanceName(CombatStance stance) noexcept
Return the stable lower-case spelling of a combat stance. @ownership Returns a borrowed pointer to im...
Definition RTSTypes.cpp:168
@ BoardTransport
@ Repair
@ Garrison
@ ReturnCargo
@ HoldPosition
@ AttackGround
@ AttackMove
@ Capture
@ Gather
@ Build
@ Attack
@ Patrol
@ SupplyRelay
@ Resupply
@ SuppressArea
@ Setup
@ Defensive
@ Aggressive
@ Passive
const char * orderKindName(OrderKind kind) noexcept
Return the stable lower-case spelling of an RTS order kind.
Definition RTSTypes.cpp:177
@ Annihilation
@ DestroyHeadquarters
@ ResourceTarget
@ InvalidArgument
@ StaleHandle
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
@ Running
Definition Container.h:602
Mutable combat state owned by the gameplay domain for one subject.
Definition Damage.h:37
Validated input used to create a domain-neutral production task.
Definition Production.h:137
Typed ability policy; lifecycle effects remain owned by the canonical effect container.
Definition RTSTypes.h:133
Automatic targeting policy for a stationary defensive building.
Definition RTSTypes.h:958
std::map< std::string, float > targetPriorities
Definition RTSTypes.h:970
Static command provider and hostile jamming policy.
Definition RTSTypes.h:1016
Construction progress and generation-checked assigned builders.
Definition RTSTypes.h:897
std::vector< ecs::EntityHandle > builders
Definition RTSTypes.h:901
Resource delivery policy; actual balances remain in the economy provider.
Definition RTSTypes.h:928
std::vector< std::string > acceptedResources
Definition RTSTypes.h:929
Building garrison capacity and generation-checked occupants.
Definition RTSTypes.h:973
std::vector< ecs::EntityHandle > occupants
Definition RTSTypes.h:976
Last indirect-fire exposure for static artillery and counter-battery observation.
Definition RTSTypes.h:1025
WorldPosition lastFirePosition
Definition RTSTypes.h:1027
RTS infrastructure projection; economy balances remain owned by the linked provider.
Definition RTSTypes.h:1005
std::string incomeResource
Definition RTSTypes.h:1011
Building health and repair economy configuration.
Definition RTSTypes.h:904
Placement world key and authoritative cell state.
Definition RTSTypes.h:859
std::string reinforcementPolicyPausedTask
Definition RTSTypes.h:949
std::map< std::string, std::size_t > reinforcementTypeLimits
Definition RTSTypes.h:945
std::string blockedProductionTask
Definition RTSTypes.h:941
std::vector< ecs::EntityHandle > reinforcements
Definition RTSTypes.h:943
std::map< std::string, std::string > reinforcementFallbacks
Definition RTSTypes.h:947
std::map< std::string, int > reinforcementTypePriorities
Definition RTSTypes.h:946
std::vector< std::string > settledProductionTasks
Definition RTSTypes.h:942
RTS shield layer for structures; canonical CombatState remains health authority.
Definition RTSTypes.h:912
Static ammunition stock and transfer policy for completed buildings.
Definition RTSTypes.h:979
std::string productionResource
Definition RTSTypes.h:985
Upgrade ids already projected onto this building.
Definition RTSTypes.h:1001
Static vision contribution projected into a faction-owned canonical map FOV provider.
Definition RTSTypes.h:991
Canonical weapon entity used by an armed building.
Definition RTSTypes.h:954
One domain-neutral command submitted to a unit's generic order queue.
Definition RTSTypes.h:101
Result< void > validate() const
Validate coordinates and command metadata without mutating state.
Definition RTSTypes.cpp:201
Persistent last-known enemy contacts derived from the faction's canonical FOV provider.
Definition RTSTypes.h:1243
std::vector< ecs::EntityHandle > buildings
Definition RTSTypes.h:1207
Cross-factory resource floors reserved for production at or above a priority threshold.
Definition RTSTypes.h:1234
std::map< std::string, Reserve > resourceReserves
Definition RTSTypes.h:1240
Deterministic high-level production and attack policy for an AI-controlled faction.
Definition RTSTypes.h:1214
LogicalId targetBuildingDefinition
Definition RTSTypes.h:1217
Completed research definitions and canonical production tasks already consumed.
Definition RTSTypes.h:1258
std::vector< std::string > consumedTasks
Definition RTSTypes.h:1260
std::map< std::string, Value::Object > unlockedDefinitions
Validated immutable rule payload accepted for each completed research id.
Definition RTSTypes.h:1262
std::vector< std::string > unlocked
Definition RTSTypes.h:1259
Deterministic idle-worker assignment policy for construction and repair.
Definition RTSTypes.h:1226
One faction's team and elimination projection.
Definition RTSTypes.h:1314
Configured victory rule; immutable while the match is running.
Definition RTSTypes.h:1308
Complete RTS order projection snapshot; entity handles must be rebound by the owning domain.
Definition RTSTypes.h:388
std::map< std::string, CommandSpec > extended
Definition RTSTypes.h:390
Owning projection of the active generic order used by RTS systems.
Definition RTSTypes.h:117
RTS-owned selection handles; handles are generation checked on use.
Definition RTSTypes.h:1146
std::vector< ecs::EntityHandle > buildings
Definition RTSTypes.h:1148
Typed RTS definition projected to the common lifecycle schema.
Definition RTSEffects.h:35
Concurrent worker capacity and current generation-checked assignments.
Definition RTSTypes.h:1099
std::vector< ecs::EntityHandle > workers
Definition RTSTypes.h:1101
Authoritative world position and interaction radius.
Definition RTSTypes.h:1086
Typed link tag for a provider-owned capability or registry entry.
Definition RTSTypes.h:229
Ability cooldowns and an optional deterministic cast/channel in progress.
Definition RTSTypes.h:673
Indirect-fire deployment and deterministic area-fire policy.
Definition RTSTypes.h:740
Capture contribution while executing a Capture order.
Definition RTSTypes.h:689
RTS stance and pursuit limits used by automatic combat policies.
Definition RTSTypes.h:610
std::map< std::string, float > targetPriorities
Definition RTSTypes.h:628
Command-network policy and derived connection state for a mobile unit or relay.
Definition RTSTypes.h:655
Unit containment state for transports and building garrisons.
Definition RTSTypes.h:693
std::vector< ecs::EntityHandle > occupants
Definition RTSTypes.h:696
Canonical combat durability state consumed by combat::DamageRuntime.
Definition RTSTypes.h:631
Suppression, recovery, retreat policy, and friendly morale aura.
Definition RTSTypes.h:724
Authoritative kinematic state used by the phase-one move slice.
Definition RTSTypes.h:560
RTS shield layer consumed before canonical health damage and regenerated deterministically.
Definition RTSTypes.h:636
Tactical ammunition logistics; weapon ammunition remains authoritative in WeaponEntity.
Definition RTSTypes.h:699
Escort geometry and combat-group coordination state.
Definition RTSTypes.h:764
SubjectRef escortInterceptTarget
Definition RTSTypes.h:783
Upgrade ids already projected onto this unit, preventing repeated multiplicative application.
Definition RTSTypes.h:790
Persistent combat experience and deterministic veteran/elite modifiers.
Definition RTSTypes.h:644
Vision contribution projected into a faction-owned canonical map FOV provider.
Definition RTSTypes.h:586
Worker gathering and delivery state; balances remain owned by the linked economy account.
Definition RTSTypes.h:598