载入中...
搜索中...
未找到
RTSTypes.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
16#include "combat/Damage.h"
17#include "common/ECS.h"
18#include "common/Identity.h"
19#include "common/Result.h"
21#include "common/SubjectRef.h"
22#include "common/Time.h"
24#include "rts/RTSEffects.h"
25
26#include <cstddef>
27#include <cstdint>
28#include <memory>
29#include <map>
30#include <optional>
31#include <span>
32#include <string>
33#include <string_view>
34#include <vector>
35
36namespace eve::crowd {
37struct CrowdAgentTag;
38}
39
40namespace eve::orders {
41class CommandQueue;
42}
43
44namespace eve::production {
45class WorkQueue;
46}
47
48namespace eve::rts {
49
50class RTSProductionActionAdapter;
51
54 float x = 0.0f;
55 float y = 0.0f;
56};
57
59enum class CombatStance : std::uint8_t { Passive, Defensive, Aggressive };
60
66[[nodiscard]] const char* combatStanceName(CombatStance stance) noexcept;
67
69enum class OrderKind : std::uint8_t {
70 Move,
71 Attack,
72 Build,
73 Gather,
76 Stop,
78 Patrol,
79 Repair,
82 Capture,
85 Escort,
88};
89
98[[nodiscard]] const char* orderKindName(OrderKind kind) noexcept;
99
109 std::string definitionId;
110 int priority = 0;
111 double timeoutSeconds = 0.0;
112 ecs::EntityHandle targetEntity{};
114 float radius = 0.0f;
115 bool append = false;
116
118 [[nodiscard]] Result<void> validate() const;
119};
120
123 std::string id;
126 std::string definitionId;
127 ecs::EntityHandle targetEntity{};
129 float radius = 0.0f;
130 bool append = false;
132};
133
135enum class AbilityTarget : std::uint8_t { Self, Ally, Enemy, Point };
136
139 std::string id;
142 std::string resourceType;
143 std::string damageType = "damage.magic";
144 float range = 0.0f;
145 float radius = 0.0f;
146 float cooldown = 0.0f;
147 std::int64_t resourceCost = 0;
148 float damage = 0.0f;
149 float healing = 0.0f;
150 float castTime = 0.0f;
152 bool interruptOnDamage = true;
153 bool appliesEffect = false;
155};
156
159public:
161 [[nodiscard]] Result<void> add(std::string_view tag);
163 [[nodiscard]] Result<void> remove(std::string_view tag);
165 [[nodiscard]] bool contains(std::string_view tag) const noexcept;
167 [[nodiscard]] const std::vector<std::string>& values() const noexcept { return values_; }
168
169private:
170 std::vector<std::string> values_;
171};
172
175
184template <typename Tag>
187public:
189 [[nodiscard]] static Result<EntityLink> bind(ecs::EntityHandle handle) {
190 if (ecs::try_get(handle) == nullptr) {
194 Diagnostic::error(DiagnosticCode::StaleHandle, "RTS entity link target is not live", "link.handle"));
195 }
197 result.handle_ = handle;
198 result.bound_ = true;
200 return Result<EntityLink>::success(std::move(result));
201 }
202
207 [[nodiscard]] static EntityLink fromHandleForRestore(ecs::EntityHandle handle) noexcept {
209 result.handle_ = handle;
210 result.bound_ = true;
211 return result;
212 }
213
215 [[nodiscard]] bool isBound() const noexcept { return bound_; }
217 [[nodiscard]] bool isStale() const noexcept { return bound_ && ecs::try_get(handle_) == nullptr; }
219 [[nodiscard]] ecs::Entity* resolve() const noexcept { return bound_ ? ecs::try_get(handle_) : nullptr; }
221 [[nodiscard]] const ecs::EntityHandle& handle() const noexcept { return handle_; }
223 void reset() noexcept {
224 bound_ = false;
225 handle_ = {};
226 }
227
228private:
229 ecs::EntityHandle handle_{};
230 bool bound_ = false;
231};
232
235
243template <typename Tag>
246public:
248 [[nodiscard]] static Result<ServiceLink> bind(std::string_view key) {
249 if (key.empty()) {
252 DiagnosticCode::InvalidArgument, "RTS service link key must not be empty", "link.key"));
253 }
255 result.key_ = key;
257 return Result<ServiceLink>::success(std::move(result));
258 }
259
261 [[nodiscard]] static ServiceLink fromKeyForRestore(std::string_view key) {
263 result.key_ = key;
264 return result;
265 }
266
268 [[nodiscard]] bool isBound() const noexcept { return !key_.empty(); }
270 [[nodiscard]] bool isStale() const noexcept { return key_.empty(); }
272 [[nodiscard]] const std::string& key() const noexcept { return key_; }
274 void reset() noexcept { key_.clear(); }
275
276private:
277 std::string key_;
278};
279
295
301struct CrowdLinkTag {};
326
329public:
337 AttributeComponent& operator=(const AttributeComponent& other);
342
344 [[nodiscard]] Result<void> setBase(std::string_view attribute, double value);
346 [[nodiscard]] Result<void> modifyBase(std::string_view attribute, double delta);
348 [[nodiscard]] bool has(std::string_view attribute) const;
350 [[nodiscard]] Result<double> getFinal(std::string_view attribute, double fallback = 0.0) const;
352 [[nodiscard]] std::size_t modifierCount() const noexcept;
365 [[nodiscard]] const eve::attributes::AttributeModifier* modifierAt(int index) const noexcept;
366
368 [[nodiscard]] Result<void> bindOwner(ecs::EntityHandle owner);
370 [[nodiscard]] bool initialized() const noexcept;
372 [[nodiscard]] Result<void> initialize(std::span<const eve::attributes::AttributeSnapshotBase> values);
374 [[nodiscard]] bool isStale() const noexcept;
376 [[nodiscard]] Result<eve::attributes::ModifierId> addModifier(eve::attributes::AttributeModifier modifier);
378 [[nodiscard]] Result<eve::attributes::AttributeProjectionSnapshot> snapshot(
379 std::span<const std::string_view> attributes) const;
381 [[nodiscard]] Result<void> restore(const eve::attributes::AttributeProjectionSnapshot& snapshot,
382 Revision expectedRevision);
383
384private:
385 struct Impl;
386 std::unique_ptr<Impl> impl_;
387};
388
391public:
393 struct Snapshot {
394 std::string queueJson;
395 std::map<std::string, CommandSpec> extended;
396 };
399 OrderComponent(const OrderComponent& other);
400 OrderComponent& operator=(const OrderComponent& other);
401 OrderComponent(OrderComponent&& other) noexcept;
402 OrderComponent& operator=(OrderComponent&& other) noexcept;
403
405 [[nodiscard]] Result<std::string> enqueue(const CommandSpec& command, int formationSlot = -1);
407 [[nodiscard]] Result<std::string> replace(const CommandSpec& command, int formationSlot = -1);
409 [[nodiscard]] Result<OrderRecord> current() const;
411 [[nodiscard]] Result<void> complete(std::string_view orderId);
413 [[nodiscard]] Result<void> fail(std::string_view orderId, std::string_view reason);
415 [[nodiscard]] Result<void> cancel(std::string_view orderId, std::string_view reason);
417 [[nodiscard]] bool empty() const noexcept;
419 void clear() noexcept;
421 [[nodiscard]] std::size_t orderCount() const noexcept;
423 [[nodiscard]] Result<std::string> snapshot() const;
425 [[nodiscard]] Result<void> restore(std::string_view json);
427 [[nodiscard]] Result<Snapshot> snapshotState() const;
429 [[nodiscard]] Result<void> restoreState(const Snapshot& snapshot);
430
431private:
433 friend class RTS;
435 std::uint64_t membershipEpoch_ = 0;
436 [[nodiscard]] orders::CommandQueue* queueForComposition() noexcept;
437
438 struct Impl;
439 std::unique_ptr<Impl> impl_;
440};
441
444public:
452 ProductionComponent& operator=(const ProductionComponent& other);
457
459 [[nodiscard]] Result<std::string> enqueue(std::string_view owner, std::string_view kind, std::string_view product,
460 Duration duration, int priority = 0);
464 [[nodiscard]] Result<void> advance(const SimulationStep& step);
466 [[nodiscard]] std::size_t taskCount() const noexcept;
468 [[nodiscard]] OptionalRef<const production::ProductionTask> taskAt(int index);
470 [[nodiscard]] OptionalRef<const production::ProductionTask> find(std::string_view taskId);
472 [[nodiscard]] Result<void> pause(std::string_view taskId);
474 [[nodiscard]] Result<void> resume(std::string_view taskId);
476 [[nodiscard]] Result<void> cancel(std::string_view taskId, std::string_view reason = "cancelled");
478 [[nodiscard]] std::vector<production::ProductionTask> readyToSettle(std::string_view kind) const;
480 [[nodiscard]] Result<void> settle(std::string_view taskId, production::ProductionSettlementReceipt receipt);
482 [[nodiscard]] Result<std::string> snapshot() const;
484 [[nodiscard]] Result<void> restore(std::string_view json);
485
486private:
488 friend class RTS;
489 [[nodiscard]] production::WorkQueue* queueForComposition() noexcept;
490
491 struct Impl;
492 std::unique_ptr<Impl> impl_;
493};
494
501class EVENGINE_API_DOMAINS Unit : public ecs::Entity {
502public:
504 ENTITY(Unit, ecs::Entity)
505
506
507 void release() override { ecs::DestroyEntity(this); }
508
510 struct Identity {
511 ecs::EntityHandle self{};
513 std::string displayName;
514 };
516 struct Definition {
518 };
524 struct Tags {
526 };
536 struct Sensing {
538 };
544 struct Crowd {
546 float radius = 0.5f;
547 float heading = 0.0f;
549 std::uint64_t runtimeOwner = 0;
550 std::string runtimeBindingKey;
551 };
553 struct Weapon {
555 };
557 struct Action {
559 };
569 struct Motion {
570 float x = 0.0f;
571 float y = 0.0f;
572 float speed = 1.0f;
573 float arrivalRadius = 0.01f;
574 bool arrived = true;
575 bool airborne = false;
576 };
578 struct Navigation {
579 std::vector<WorldPosition> waypoints;
580 std::size_t waypointIndex = 0;
581 std::string plannedOrderId;
584 int movementPriority = 0;
585 bool patrolInitialized = false;
586 bool patrolTowardTarget = true;
587 bool trafficWaiting = false;
588 bool unreachable = false;
589 bool unreachableReported = false;
590 float formationSpeedFactor = 1.f;
591 std::optional<WorldPosition> formationTarget;
592 std::optional<WorldPosition>
594 bool combatSlotWaiting = false;
595 std::optional<WorldPosition> trafficRecoveryTarget;
596 };
598 struct Vision {
599 float sightRange = 0.0f;
600 float detectionRange = 0.0f;
601 float detectionStrength = 0.0f;
602 float radarRange = 0.0f;
603 float radarResolution = 0.0f;
604 float jammingRange = 0.0f;
605 float stealth = 0.0f;
606 bool enabled = true;
607 bool cloaked = false;
608 };
610 struct Worker {
611 std::string resourceType;
614 float cargo = 0.0f;
615 float capacity = 0.0f;
616 float gatherRate = 0.0f;
617 float buildRate = 1.0f;
618 float repairRate = 0.0f;
619 bool autoAssign = false;
620 };
622 struct Combat {
623 ecs::EntityHandle target{};
624 CombatStance stance = CombatStance::Defensive;
625 float acquisitionRange = 0.0f;
626 float engagementRange = 0.0f;
627 float leashRange = 0.0f;
628 float guardX = 0.0f;
629 float guardY = 0.0f;
630 bool guardSet = false;
631 bool holdPosition = false;
632 bool attackMove = false;
633 float suppressionPerShot = 0.0f;
634 float upgradeDamageFactor = 1.0f;
635 float turnRateDegrees = 0.0f;
636 float aimToleranceDegrees = 0.01f;
637 float firingHeight = 1.0f;
638 float targetHeight = 1.0f;
639 std::uint64_t shotSequence = 0;
640 std::map<std::string, float> targetPriorities;
641 };
643 struct Durability {
645 bool alive = true;
646 };
648 struct Shield {
649 float value = 0.0f;
650 float capacity = 0.0f;
651 float regenRate = 0.0f;
652 float regenDelay = 0.0f;
653 float cooldown = 0.0f;
654 };
656 struct Veterancy {
657 float experience = 0.0f;
658 int level = 0;
659 float veteranThreshold = 0.0f;
660 float eliteThreshold = 0.0f;
661 float veteranDamageFactor = 1.0f;
662 float eliteDamageFactor = 1.0f;
663 float veteranHealthFactor = 1.0f;
664 float eliteHealthFactor = 1.0f;
665 };
667 struct Command {
668 float range = 0.0f;
669 int capacity = 0;
670 int load = 0;
671 int cost = 1;
672 int priority = 0;
673 float jammingRange = 0.0f;
674 float outOfCommandSpeedFactor = 1.0f;
675 float outOfCommandDamageFactor = 1.0f;
676 bool requiresCommand = false;
677 bool relayRequiresUplink = false;
678 bool relayActive = false;
679 bool jammed = false;
680 bool inCommand = true;
681 ecs::EntityHandle source{};
682 ecs::EntityHandle uplink{};
683 };
685 struct Abilities {
687 struct Cooldown { std::string id; float remaining = 0.0f; };
689 struct Channel {
691 ecs::EntityHandle target{};
693 double startingHealth = 0.0;
694 float remaining = 0.0f;
695 float tickRemaining = 0.0f;
696 };
697 std::vector<Cooldown> cooldowns;
698 std::optional<Channel> channel;
699 };
701 struct Capture {
702 float rate = 0.0f;
703 };
705 struct Containment {
707 std::size_t capacity = 0;
708 std::vector<ecs::EntityHandle> occupants;
709 };
711 struct Supply {
712 float stock = 0.0f;
713 float capacity = 0.0f;
714 float range = 0.0f;
715 float transferRate = 0.0f;
716 float transferProgress = 0.0f;
717 float reservedStock = 0.0f;
718 float autoThreshold = 0.5f;
719 float priority = 1.0f;
720 bool autoDispatch = false;
721 bool relayEnabled = false;
722 bool returning = false;
723 bool rendezvousActive = false;
724 bool convoyWaiting = false;
725 std::size_t convoyIndex = 0;
726 ecs::EntityHandle assignedTarget{};
727 ecs::EntityHandle convoyLeader{};
730 float rendezvousThreat = 0.0f;
731 bool rendezvousAvoidedThreat = false;
732 float routeThreat = 0.0f;
733 bool routeAvoidedThreat = false;
734 };
736 struct Morale {
737 float suppression = 0.0f;
738 float capacity = 0.0f;
739 float recoveryRate = 0.0f;
740 float suppressedSpeedFactor = 1.0f;
741 float suppressedDamageFactor = 1.0f;
742 float retreatThreshold = 0.8f;
743 float retreatDistance = 6.0f;
744 float auraRange = 0.0f;
745 float auraSuppressionFactor = 1.0f;
746 float auraRecoveryBonus = 0.0f;
747 bool active = false;
748 bool retreatEnabled = false;
749 bool retreating = false;
750 };
752 struct Artillery {
753 float deployTime = 0.0f;
754 float deployRemaining = 0.0f;
755 float shootAndScootDistance = 0.0f;
756 float previousX = 0.0f;
757 float previousY = 0.0f;
760 float relocationThreat = 0.0f;
761 int relocationConflictCount = 0;
762 bool positionInitialized = false;
763 bool relocating = false;
764 bool hasDepartedPosition = false;
765 std::uint32_t shotSequence = 0;
766 int suppressionShotsRemaining = -1;
767 ecs::EntityHandle fireSupportRequester{};
768 ecs::EntityHandle observedFireSpotter{};
769 bool usingObservedFire = false;
770 SimulationTick lastFireTick{};
772 bool autoCounterBattery = false;
773 std::uint64_t counterBatteryWindowTicks = 0;
774 };
776 struct Tactics {
777 std::uint64_t combatGroup = 0;
778 int threatSector = 0;
779 float coordinatedVolleyInterval = 0.0f;
780 float volleyReleaseRemaining = 0.0f;
781 float fireControlEffectiveness = 1.0f;
782 bool volleyHolding = false;
783 ecs::EntityHandle escortTarget{};
784 float escortOffsetX = 0.0f;
785 float escortOffsetY = 0.0f;
786 float protectionRange = 8.0f;
787 float guardX = 0.0f;
788 float guardY = 0.0f;
789 bool guardSet = false;
790 int escortScreenSector = 0;
791 bool escortSectorMatched = false;
792 bool escortReinforcing = false;
793 int escortReinforcementSector = 0;
794 bool escortRearGuard = false;
796 std::uint32_t escortHandoffCount = 0;
797 int retreatFireTeam = -1;
798 float retreatCoverElapsed = 0.0f;
799 bool retreatCovering = false;
800 };
802 struct Technology {
803 std::vector<std::string> applied;
804 };
805
806 COMPONENT(Identity, identity)
807 COMPONENT(Definition, definition)
808 COMPONENT(Attributes, attributes)
809 COMPONENT(Tags, tags)
810 COMPONENT(Effects, effects)
811 COMPONENT(Orders, orders)
812 COMPONENT(Sensing, sensing)
813 COMPONENT(Steering, steering)
814 COMPONENT(Crowd, crowd)
815 COMPONENT(Weapon, weapon)
816 COMPONENT(Action, action)
817 COMPONENT(Settlement, settlement)
818 COMPONENT(Faction, faction)
819 COMPONENT(Motion, motion)
820 COMPONENT(Navigation, navigation)
821 COMPONENT(Vision, vision)
822 COMPONENT(Worker, worker)
823 COMPONENT(Combat, combat)
824 COMPONENT(Durability, durability)
825 COMPONENT(Shield, shield)
826 COMPONENT(Veterancy, veterancy)
827 COMPONENT(Command, command)
828 COMPONENT(Abilities, abilities)
829 COMPONENT(Capture, capture)
830 COMPONENT(Containment, containment)
831 COMPONENT(Supply, supply)
832 COMPONENT(Morale, morale)
833 COMPONENT(Artillery, artillery)
834 COMPONENT(Tactics, tactics)
835 COMPONENT(Technology, technology)
836
837
848 [[nodiscard]] static Unit* createUnit(SubjectRef subject = {}, LogicalId definition = {});
849};
850
852class EVENGINE_API_DOMAINS Building : public ecs::Entity {
853public:
855 ENTITY(Building, ecs::Entity)
856
857
858 void release() override { ecs::DestroyEntity(this); }
859
861 struct Identity {
862 ecs::EntityHandle self{};
864 std::string displayName;
865 };
867 struct Definition {
869 };
871 struct Placement {
873 int cellX = 0;
874 int cellY = 0;
875 float worldX = 0.0f;
876 float worldY = 0.0f;
877 float rotation = 0.0f;
878 bool placed = false;
879 };
885 struct Economy {
887 };
893 struct Tags {
895 };
910 float progress = 1.0f;
911 float buildTimeSeconds = 0.0f;
912 bool paused = false;
913 std::vector<ecs::EntityHandle> builders;
914 };
916 struct Integrity {
918 bool alive = true;
919 float repairCostPerHealth = 0.0f;
920 float repairCostRemainder = 0.0f;
921 std::string repairResource;
922 };
924 struct Shield {
925 float value = 0.0f;
926 float capacity = 0.0f;
927 float regenRate = 0.0f;
928 float regenDelay = 0.0f;
929 float cooldown = 0.0f;
930 };
932 struct Capture {
933 bool capturable = false;
934 float durationSeconds = 5.0f;
935 float progress = 0.0f;
936 ecs::EntityHandle capturingFaction{};
937 bool blockedByGarrison = false;
939 float scorePerSecond = 0.0f;
940 };
942 struct Dropoff {
943 std::vector<std::string> acceptedResources;
944 float radius = 1.0f;
945 };
947 struct Rally {
948 bool enabled = false;
950 std::uint64_t combatGroup = 0;
951 ecs::EntityHandle transport{};
952 std::size_t minimumTransportLoad = 1;
953 bool transportActive = false;
954 bool productionSpawnBlocked = false;
956 std::vector<std::string> settledProductionTasks;
957 std::vector<ecs::EntityHandle> reinforcements;
958 std::size_t reinforcementLimit = 0;
959 std::map<std::string, std::size_t> reinforcementTypeLimits;
960 std::map<std::string, int> reinforcementTypePriorities;
961 std::map<std::string, std::string> reinforcementFallbacks;
962 bool reinforcementCapped = false;
964 float reinforcementAutoCancelDelay = 0.0f;
965 float reinforcementCappedSeconds = 0.0f;
966 };
968 struct Weapon {
970 };
972 struct Combat {
973 ecs::EntityHandle target{};
974 ecs::EntityHandle airDefenseNetworkRoot{};
975 float acquisitionRange = 0.0f;
976 float engagementRange = 0.0f;
977 float airDefenseNetworkRange = 0.0f;
978 std::size_t airDefenseNetworkSize = 0;
979 float turnRateDegrees = 0.0f;
980 float aimToleranceDegrees = 0.01f;
981 float firingHeight = 2.0f;
982 float targetHeight = 1.5f;
983 std::uint64_t shotSequence = 0;
984 std::map<std::string, float> targetPriorities;
985 };
987 struct Garrison {
988 std::size_t capacity = 0;
989 float damageBonusPerOccupant = 0.0f;
990 std::vector<ecs::EntityHandle> occupants;
991 };
993 struct Supply {
994 float stock = 0.0f;
995 float capacity = 0.0f;
996 float range = 0.0f;
997 float transferRate = 0.0f;
998 float transferProgress = 0.0f;
1000 std::int64_t productionCostPerRound = 0;
1001 float productionRate = 0.0f;
1002 float productionProgress = 0.0f;
1003 };
1005 struct Vision {
1006 float sightRange = 0.0f;
1007 float detectionRange = 0.0f;
1008 float detectionStrength = 0.0f;
1009 float radarRange = 0.0f;
1010 float radarResolution = 0.0f;
1011 float jammingRange = 0.0f;
1012 bool enabled = true;
1013 };
1015 struct Technology {
1016 std::vector<std::string> applied;
1017 };
1020 float powerProduced = 0.0f;
1021 float powerConsumed = 0.0f;
1022 int powerPriority = 0;
1023 bool powered = true;
1024 float buildInfluenceRadius = 0.0f;
1025 std::string incomeResource;
1026 float incomeRate = 0.0f;
1027 float incomeProgress = 0.0f;
1028 };
1030 struct Command {
1031 float range = 0.0f;
1032 int capacity = 0;
1033 int load = 0;
1034 float jammingRange = 0.0f;
1035 bool jammed = false;
1036 bool active = false;
1037 };
1043
1044 COMPONENT(Identity, identity)
1045 COMPONENT(Definition, definition)
1046 COMPONENT(Placement, placement)
1047 COMPONENT(Production, production)
1048 COMPONENT(Economy, economy)
1049 COMPONENT(Orders, orders)
1050 COMPONENT(Tags, tags)
1051 COMPONENT(Effects, effects)
1052 COMPONENT(Settlement, settlement)
1053 COMPONENT(Faction, faction)
1054 COMPONENT(Construction, construction)
1055 COMPONENT(Integrity, integrity)
1056 COMPONENT(Shield, shield)
1057 COMPONENT(Capture, capture)
1058 COMPONENT(Dropoff, dropoff)
1059 COMPONENT(Rally, rally)
1060 COMPONENT(Weapon, weapon)
1061 COMPONENT(Combat, combat)
1062 COMPONENT(Garrison, garrison)
1063 COMPONENT(Supply, supply)
1064 COMPONENT(Vision, vision)
1065 COMPONENT(Technology, technology)
1066 COMPONENT(Infrastructure, infrastructure)
1067 COMPONENT(Command, command)
1068 COMPONENT(IndirectFire, indirectFire)
1069
1070
1081 [[nodiscard]] static Building* createBuilding(SubjectRef subject = {}, LogicalId definition = {});
1082};
1083
1085class EVENGINE_API_DOMAINS ResourceNode : public ecs::Entity {
1086public:
1088 ENTITY(ResourceNode, ecs::Entity)
1089
1090
1091 void release() override { ecs::DestroyEntity(this); }
1092
1094 struct Identity {
1095 ecs::EntityHandle self{};
1097 std::string displayName;
1098 };
1100 struct Position {
1101 float x = 0.0f;
1102 float y = 0.0f;
1103 float radius = 1.0f;
1104 };
1106 struct Stock {
1107 std::string resourceType;
1108 float remaining = 0.0f;
1109 float maximum = 0.0f;
1110 bool infinite = false;
1111 };
1113 struct Harvest {
1114 std::size_t capacity = 1;
1115 std::vector<ecs::EntityHandle> workers;
1116 };
1117
1118 COMPONENT(Identity, identity)
1119 COMPONENT(Position, position)
1120 COMPONENT(Stock, stock)
1121 COMPONENT(Harvest, harvest)
1122
1123
1129 [[nodiscard]] static ResourceNode* createResourceNode(SubjectRef subject = {});
1130};
1131
1133class Player : public ecs::Entity {
1134public:
1136 ENTITY(Player, ecs::Entity)
1137
1138
1139 void release() override { ecs::DestroyEntity(this); }
1140
1142 struct Identity {
1143 ecs::EntityHandle self{};
1145 std::string displayName;
1146 };
1152 struct Economy {
1154 };
1156 struct Social {
1158 };
1160 struct Selection {
1161 std::vector<ecs::EntityHandle> units;
1162 std::vector<ecs::EntityHandle> buildings;
1164 std::uint64_t revision = 0;
1166 SimulationTick tick = SimulationTick::zero();
1167 };
1172 COMPONENT(Identity, identity)
1173 COMPONENT(Authority, authority)
1174 COMPONENT(Economy, economy)
1175 COMPONENT(Social, social)
1176 COMPONENT(Selection, selection)
1177 COMPONENT(GameEvent, eventStream)
1178
1179
1188 [[nodiscard]] static Player* createPlayer(SubjectRef subject = {});
1189};
1190
1192class EVENGINE_API_DOMAINS Faction : public ecs::Entity {
1193public:
1195 ENTITY(Faction, ecs::Entity)
1196
1197
1198 void release() override { ecs::DestroyEntity(this); }
1199
1201 struct Identity {
1202 ecs::EntityHandle self{};
1204 std::string displayName;
1205 };
1211 struct Economy {
1213 };
1215 struct Social {
1217 };
1219 struct Members {
1220 std::vector<ecs::EntityHandle> units;
1221 std::vector<ecs::EntityHandle> buildings;
1222 };
1228 struct Strategy {
1232 int desiredWorkers = 0;
1233 int attackThreshold = 1;
1234 float thinkInterval = 1.0f;
1235 float thinkAccumulator = 0.0f;
1236 float formationSpacing = 1.1f;
1237 bool enabled = false;
1238 };
1240 struct Workforce {
1241 bool autoConstruction = false;
1242 bool autoRepair = false;
1243 std::size_t maxBuildersPerSite = 2;
1244 std::size_t maxRepairersPerBuilding = 2;
1245 std::size_t reserveWorkers = 0;
1246 };
1250 struct Reserve {
1251 std::int64_t amount = 0;
1252 int minimumPriority = 0;
1253 };
1254 std::map<std::string, Reserve> resourceReserves;
1255 };
1257 struct Intel {
1259 struct Contact {
1261 std::string kind;
1263 double ageSeconds = 0.0;
1264 bool visible = false;
1265 bool detected = false;
1266 };
1268 bool enabled = false;
1269 std::vector<Contact> contacts;
1270 };
1272 struct Technology {
1273 std::vector<std::string> unlocked;
1274 std::vector<std::string> consumedTasks;
1276 std::map<std::string, Value::Object> unlockedDefinitions;
1277 };
1278
1279 COMPONENT(Identity, identity)
1280 COMPONENT(Authority, authority)
1281 COMPONENT(Economy, economy)
1282 COMPONENT(Social, social)
1283 COMPONENT(Members, members)
1284 COMPONENT(GameEvent, eventStream)
1285 COMPONENT(Strategy, strategy)
1286 COMPONENT(Workforce, workforce)
1287 COMPONENT(ProductionPolicy, productionPolicy)
1288 COMPONENT(Intel, intel)
1289 COMPONENT(Technology, technology)
1290
1291
1300 [[nodiscard]] static Faction* createFaction(SubjectRef subject = {});
1301};
1302
1307enum class VictoryRule : std::uint8_t {
1313 Mission,
1314};
1316enum class MatchPhase : std::uint8_t { Setup, Running, Finished };
1317
1319enum class MissionObjectiveKind : std::uint8_t {
1325 ReachScore,
1327};
1329enum class MissionObjectiveStatus : std::uint8_t { Pending, Completed, Failed };
1330
1333 std::string id;
1334 MissionObjectiveKind kind = MissionObjectiveKind::EliminateFaction;
1335 int beneficiaryTeam = 0;
1338 std::string archetype;
1339 std::string resourceType;
1340 Duration requiredDuration{};
1341 double targetValue = 0.0;
1342 std::vector<SubjectRef> requiredSubjects;
1344 bool endsMatch = true;
1346 bool failsMatch = true;
1347};
1348
1352 MissionObjectiveStatus status = MissionObjectiveStatus::Pending;
1353 std::uint64_t completedSequence = 0;
1354};
1355
1357enum class MissionTriggerEventKind : std::uint8_t {
1365 UnitDied,
1367 Custom,
1368};
1369
1372 MissionTriggerEventKind kind = MissionTriggerEventKind::Custom;
1374 std::string id;
1377 std::string archetype;
1378};
1379
1381enum class MissionVariableCompare : std::uint8_t { Eq, Ne, Lt, Le, Gt, Ge };
1382
1385 std::string variable;
1386 MissionVariableCompare op = MissionVariableCompare::Eq;
1387 double value = 0.0;
1388};
1389
1391enum class MissionActionKind : std::uint8_t {
1394 StartTimer,
1395 StopTimer,
1396 ResetTimer,
1401 EmitCustom,
1402 Script,
1403};
1404
1407 MissionActionKind kind = MissionActionKind::Script;
1408 std::string targetId;
1409 double numeric = 0.0;
1411};
1412
1415 std::string id;
1416 bool enabled = true;
1417 bool once = true;
1418 int priority = 0;
1419 std::vector<MissionTriggerEventFilter> events;
1420 std::vector<MissionTriggerCondition> conditions;
1421 std::vector<MissionAction> actions;
1422 bool fired = false;
1423};
1424
1427 std::string id;
1428 bool enabled = true;
1429 float minX = 0.0f;
1430 float minY = 0.0f;
1431 float maxX = 0.0f;
1432 float maxY = 0.0f;
1434 std::vector<SubjectRef> subjects;
1436 std::vector<SubjectRef> occupants;
1437};
1438
1441 std::string id;
1443 Duration elapsed{};
1444 bool running = false;
1445 bool repeating = false;
1446};
1447
1450 std::string id;
1451 double value = 0.0;
1452};
1453
1456 MissionTriggerEventKind kind = MissionTriggerEventKind::Custom;
1457 std::string id;
1460 std::string archetype;
1461 int team = -1;
1462};
1463
1466 std::uint64_t sequence = 0;
1467 std::uint64_t tick = 0;
1468 std::string triggerId;
1469 std::string kind;
1470 std::string targetId;
1471 double numeric = 0.0;
1473};
1474
1476class EVENGINE_API_DOMAINS Match : public ecs::Entity {
1477public:
1479 ENTITY(Match, ecs::Entity)
1481 void release() override { ecs::DestroyEntity(this); }
1482
1484 struct Identity {
1485 ecs::EntityHandle self{};
1487 };
1489 struct Rules {
1490 VictoryRule rule = VictoryRule::Annihilation;
1491 std::string archetype;
1492 double targetValue = 0.0;
1494 Duration timeLimit{};
1499 bool suddenDeath = false;
1500 };
1504 struct Entry {
1506 int team = 0;
1507 bool eliminated = false;
1508 bool surrendered = false;
1509 std::string reason;
1510 };
1511 std::vector<Entry> entries;
1512 };
1514 struct State {
1515 MatchPhase phase = MatchPhase::Setup;
1516 int winningTeam = -1;
1517 std::uint64_t updateSequence = 0;
1518 Duration elapsed{};
1519 bool suddenDeathActive = false;
1520 };
1522 struct Scores {
1524 struct Entry {
1525 int team = 0;
1526 double value = 0.0;
1527 };
1529 std::vector<Entry> entries;
1530 };
1532 struct Objectives {
1533 std::vector<MissionObjectiveState> values;
1534 };
1536 struct Events {
1538 struct Event {
1539 std::uint64_t sequence = 0;
1540 std::string kind;
1542 int team = -1;
1543 std::string reason;
1544 };
1545 std::vector<Event> values;
1546 };
1551 struct Campaign {
1552 std::vector<MissionTrigger> triggers;
1553 std::vector<MissionRegionMonitor> monitors;
1554 std::vector<MissionTimer> timers;
1555 std::vector<MissionVariable> variables;
1556 std::vector<MissionPendingEvent> pending;
1557 std::vector<MissionActionLogEntry> actions;
1559 std::vector<SubjectRef> trackedAlive;
1561 std::uint64_t bridgedEventSequence = 0;
1562 std::uint64_t actionSequence = 0;
1563 };
1564
1565 COMPONENT(Identity, identity)
1566 COMPONENT(Rules, rules)
1567 COMPONENT(Participants, participants)
1568 COMPONENT(State, state)
1569 COMPONENT(Scores, scores)
1570 COMPONENT(Objectives, objectives)
1571 COMPONENT(Events, events)
1572 COMPONENT(Campaign, campaign)
1573
1574
1580 [[nodiscard]] static Match* createMatch(SubjectRef subject = {});
1581};
1582
1583} // namespace eve::rts
double y
double x
LogicalId target
bool & active
float duration
int subject
Definition AnimSmr.cpp:163
Owner-aware canonical attribute state shared by gameplay adapters.
std::uint64_t revision
int priority
Deterministic damage, poise, hit-reaction and knockback resolution.
eve::resource::CostSpec cost
EnvironmentTest definition
#define EVENGINE_API_DOMAINS
Definition Export.h:110
float maximum[3]
const GltfImportRequest & request
std::uint32_t alive
std::uint32_t capacity
wgpu::PopErrorScopeStatus status
Strong identity values shared by persistence, content and logical-name APIs.
Range range
std::array< float, 4 > rotation
std::array< float, 3 > position
std::shared_ptr< std::atomic< bool > > cancelled
Poco::JSON::Object::Ptr result
std::unordered_set< std::string > tags
double radius
Definition MeleeHit.cpp:42
int level
const std::string * tag
std::shared_ptr< OceanGpuSpectrum > owner
Placement placement
std::unique_ptr< gpgpu::Sequence > sequence
Definition OnnxGpgpu.cpp:43
std::vector< particles::ParticleRecordEvent > events
std::string action
Definition PlayHost.cpp:118
std::string taskId
std::set< std::string > values
Object::Ptr value
std::map< std::string, double > attributes
std::string attribute
RTS effect adapter with morale, suppression and production policies.
Move-only, checked operation results for the common layer.
Strong generation-qualified handles for non-ECS runtime registries.
std::string_view source
std::string kind
double current
float phase
Stable reference to a runtime gameplay subject.
bool placed
SimulationTick tick
Battle::Objectives objectives
bool visible
Common time values and an injectable deterministic simulation clock.
float step
Definition TreeMesh.cpp:451
V3 heading
Definition TreeMesh.cpp:429
std::map< std::string, std::span< const std::uint8_t > > members
uint32_t index
uint64_t identity
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Signed, fixed-resolution simulation duration in nanoseconds.
Definition Time.h:43
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:414
Move-only operation result carrying either a value or Status.
Definition Result.h:176
static Result success(T value)
Construct a successful result owning value.
Definition Result.h:185
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Process-local slot identity tagged by the registry that owns it.
Strong, domain-neutral reference to a runtime subject.
Definition SubjectRef.h:26
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
std::map< std::string, Value > Object
Definition Value.h:34
Canonical attributes component adapter, backed by attributes::AttributeSet.
Definition RTSTypes.h:328
AttributeComponent & operator=(AttributeComponent &&other) noexcept
Operator =.
AttributeComponent(AttributeComponent &&other) noexcept
Attribute component.
~AttributeComponent()
Attribute component.
RTS building domain root with placement and production composition.
Definition RTSTypes.h:852
Validates a typed selection and fans one command out in formation order.
Definition RTSSystems.h:216
Faction domain root; membership is a set of typed runtime handles.
Definition RTSTypes.h:1192
Independent match composition root; factions may participate in different matches.
Definition RTSTypes.h:1476
Generic orders component adapter; the queue remains the sole order owner.
Definition RTSTypes.h:390
Player domain root; selection is RTS-local, authority/economy/social are links.
Definition RTSTypes.h:1133
Production adapter whose queue owns all task state.
Definition RTSTypes.h:443
~ProductionComponent()
Production component.
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.
Owns RTS root entities and coordinates the phase-one systems.
Definition RTS.h:105
Harvestable RTS resource node; deposited balances are owned by an external resource account.
Definition RTSTypes.h:1085
Entity-local sorted tags; this is the RTS entity's tag authority.
Definition RTSTypes.h:158
const std::vector< std::string > & values() const noexcept
Return tags in deterministic order.
Definition RTSTypes.h:167
RTS unit domain root.
Definition RTSTypes.h:501
MissionObjectiveKind
Deterministic campaign objective kinds owned by a Match.
Definition RTSTypes.h:1319
MissionVariableCompare
Variable comparison used as an AND gate on a trigger.
Definition RTSTypes.h:1381
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
MissionTriggerEventKind
Domain event kinds that can wake Match campaign triggers.
Definition RTSTypes.h:1357
OrderKind
Commands shared by movement, combat, construction and gathering.
Definition RTSTypes.h:69
MatchPhase
Lifecycle of one independent RTS match root.
Definition RTSTypes.h:1316
CombatStance
Automatic target-acquisition policy for an RTS unit.
Definition RTSTypes.h:59
MissionObjectiveStatus
Objective lifecycle projection.
Definition RTSTypes.h:1329
AbilityTarget
Target relationship accepted by one RTS ability.
Definition RTSTypes.h:135
MissionActionKind
Built-in campaign actions; Script entries are retained for the game layer.
Definition RTSTypes.h:1391
const char * orderKindName(OrderKind kind) noexcept
Return the stable lower-case spelling of an RTS order kind.
Definition RTSTypes.cpp:177
VictoryRule
Supported deterministic RTS victory policies.
Definition RTSTypes.h:1307
@ Mission
Campaign/mission mode: Match::Objectives own completion and failure settlement.
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
bool enabled
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
Mutable combat state owned by the gameplay domain for one subject.
Definition Damage.h:38
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:138
std::string damageType
Definition RTSTypes.h:143
AbilityTarget target
Definition RTSTypes.h:141
std::int64_t resourceCost
Definition RTSTypes.h:147
std::string resourceType
Definition RTSTypes.h:142
RTSEffectDefinition effect
Definition RTSTypes.h:154
LogicalId casterDefinition
Definition RTSTypes.h:140
ActionLinkTag public API.
Definition RTSTypes.h:303
AuthorityLinkTag public API.
Definition RTSTypes.h:311
BuildingLinkTag public API.
Definition RTSTypes.h:287
Deterministic contested capture state.
Definition RTSTypes.h:932
Automatic targeting policy for a stationary defensive building.
Definition RTSTypes.h:972
std::map< std::string, float > targetPriorities
Definition RTSTypes.h:984
Static command provider and hostile jamming policy.
Definition RTSTypes.h:1030
Construction progress and generation-checked assigned builders.
Definition RTSTypes.h:909
std::vector< ecs::EntityHandle > builders
Definition RTSTypes.h:913
Logical building definition identity.
Definition RTSTypes.h:867
Resource delivery policy; actual balances remain in the economy provider.
Definition RTSTypes.h:942
std::vector< std::string > acceptedResources
Definition RTSTypes.h:943
Economy account/provider link.
Definition RTSTypes.h:885
Lifecycle-only effects.
Definition RTSTypes.h:897
RTSEffectComponent values
Definition RTSTypes.h:898
Owning faction link.
Definition RTSTypes.h:905
rts::FactionLink link
Definition RTSTypes.h:906
Building garrison capacity and generation-checked occupants.
Definition RTSTypes.h:987
std::vector< ecs::EntityHandle > occupants
Definition RTSTypes.h:990
Runtime identity.
Definition RTSTypes.h:861
Last indirect-fire exposure for static artillery and counter-battery observation.
Definition RTSTypes.h:1039
RTS infrastructure projection; economy balances remain owned by the linked provider.
Definition RTSTypes.h:1019
Building health and repair economy configuration.
Definition RTSTypes.h:916
combat::CombatState state
Definition RTSTypes.h:917
Generic building orders.
Definition RTSTypes.h:889
OrderComponent values
Definition RTSTypes.h:890
Placement world key and authoritative cell state.
Definition RTSTypes.h:871
Canonical production queue.
Definition RTSTypes.h:881
ProductionComponent values
Definition RTSTypes.h:882
Rally order copied to newly produced units.
Definition RTSTypes.h:947
std::string reinforcementPolicyPausedTask
Definition RTSTypes.h:963
std::map< std::string, std::size_t > reinforcementTypeLimits
Definition RTSTypes.h:959
std::string blockedProductionTask
Definition RTSTypes.h:955
std::vector< ecs::EntityHandle > reinforcements
Definition RTSTypes.h:957
std::map< std::string, std::string > reinforcementFallbacks
Definition RTSTypes.h:961
std::map< std::string, int > reinforcementTypePriorities
Definition RTSTypes.h:960
std::vector< std::string > settledProductionTasks
Definition RTSTypes.h:956
Settlement provider link.
Definition RTSTypes.h:901
RTS shield layer for structures; canonical CombatState remains health authority.
Definition RTSTypes.h:924
Static ammunition stock and transfer policy for completed buildings.
Definition RTSTypes.h:993
std::string productionResource
Definition RTSTypes.h:999
Building-local tags.
Definition RTSTypes.h:893
Upgrade ids already projected onto this building.
Definition RTSTypes.h:1015
std::vector< std::string > applied
Definition RTSTypes.h:1016
Static vision contribution projected into a faction-owned canonical map FOV provider.
Definition RTSTypes.h:1005
Canonical weapon entity used by an armed building.
Definition RTSTypes.h:968
One domain-neutral command submitted to a unit's generic order queue.
Definition RTSTypes.h:106
std::string definitionId
Definition RTSTypes.h:109
ecs::EntityHandle targetEntity
Definition RTSTypes.h:112
Result< void > validate() const
Validate coordinates and command metadata without mutating state.
Definition RTSTypes.cpp:201
WorldPosition target
Definition RTSTypes.h:108
WorldPosition secondaryTarget
Definition RTSTypes.h:113
ContainerLinkTag public API.
Definition RTSTypes.h:289
CrowdLinkTag public API.
Definition RTSTypes.h:301
EconomyLinkTag public API.
Definition RTSTypes.h:309
Typed link tag for links to another ECS entity.
Definition RTSTypes.h:174
FactionLinkTag public API.
Definition RTSTypes.h:281
Authority provider link.
Definition RTSTypes.h:1207
Economy account/provider link.
Definition RTSTypes.h:1211
Event stream/provider link.
Definition RTSTypes.h:1224
Runtime identity.
Definition RTSTypes.h:1201
Persistent last-known enemy contacts derived from the faction's canonical FOV provider.
Definition RTSTypes.h:1257
std::vector< Contact > contacts
Definition RTSTypes.h:1269
Authoritative faction membership handles.
Definition RTSTypes.h:1219
std::vector< ecs::EntityHandle > buildings
Definition RTSTypes.h:1221
std::vector< ecs::EntityHandle > units
Definition RTSTypes.h:1220
Cross-factory resource floors reserved for production at or above a priority threshold.
Definition RTSTypes.h:1248
std::map< std::string, Reserve > resourceReserves
Definition RTSTypes.h:1254
Social graph/provider link.
Definition RTSTypes.h:1215
Deterministic high-level production and attack policy for an AI-controlled faction.
Definition RTSTypes.h:1228
Completed research definitions and canonical production tasks already consumed.
Definition RTSTypes.h:1272
std::vector< std::string > consumedTasks
Definition RTSTypes.h:1274
std::map< std::string, Value::Object > unlockedDefinitions
Validated immutable rule payload accepted for each completed research id.
Definition RTSTypes.h:1276
std::vector< std::string > unlocked
Definition RTSTypes.h:1273
Deterministic idle-worker assignment policy for construction and repair.
Definition RTSTypes.h:1240
GameEventLinkTag public API.
Definition RTSTypes.h:315
Campaign trigger host owned by the match (WC3-style events/monitors/timers).
Definition RTSTypes.h:1551
std::vector< MissionVariable > variables
Definition RTSTypes.h:1555
std::vector< MissionTrigger > triggers
Definition RTSTypes.h:1552
std::vector< MissionActionLogEntry > actions
Definition RTSTypes.h:1557
std::vector< MissionPendingEvent > pending
Definition RTSTypes.h:1556
std::vector< MissionTimer > timers
Definition RTSTypes.h:1554
std::vector< MissionRegionMonitor > monitors
Definition RTSTypes.h:1553
std::vector< SubjectRef > trackedAlive
Subjects known alive on the previous campaign step for death edges.
Definition RTSTypes.h:1559
Deterministic retained lifecycle events.
Definition RTSTypes.h:1536
std::vector< Event > values
Definition RTSTypes.h:1545
Runtime and persistent identity.
Definition RTSTypes.h:1484
Campaign objectives evaluated each match step.
Definition RTSTypes.h:1532
std::vector< MissionObjectiveState > values
Definition RTSTypes.h:1533
One faction's team and elimination projection.
Definition RTSTypes.h:1502
std::vector< Entry > entries
Definition RTSTypes.h:1511
Configured victory rule; immutable while the match is running.
Definition RTSTypes.h:1489
std::string archetype
Definition RTSTypes.h:1491
One team's accumulated score.
Definition RTSTypes.h:1524
Match-owned team scores for ScoreTarget and timed score settlement.
Definition RTSTypes.h:1522
std::vector< Entry > entries
Sorted by ascending team id for deterministic projection.
Definition RTSTypes.h:1529
Authoritative match outcome and clock.
Definition RTSTypes.h:1514
Retained Script-action activation for game-layer consumption.
Definition RTSTypes.h:1465
One deferred campaign side-effect descriptor.
Definition RTSTypes.h:1406
Persistent mission objective definition using stable subjects and team ids.
Definition RTSTypes.h:1332
std::vector< SubjectRef > requiredSubjects
Definition RTSTypes.h:1342
Mutable objective status retained with the match.
Definition RTSTypes.h:1350
MissionObjectiveSpec spec
Definition RTSTypes.h:1351
Queued campaign event waiting to wake triggers.
Definition RTSTypes.h:1455
Axis-aligned world region that emits enter/exit events for live subjects.
Definition RTSTypes.h:1426
std::vector< SubjectRef > occupants
Runtime occupants discovered on the previous step.
Definition RTSTypes.h:1436
std::vector< SubjectRef > subjects
Definition RTSTypes.h:1434
Match-owned countdown that emits TimerElapsed when it reaches zero.
Definition RTSTypes.h:1440
One variable predicate evaluated against Match::Campaign variables.
Definition RTSTypes.h:1384
Optional filters that narrow one trigger event subscription.
Definition RTSTypes.h:1371
std::string id
Timer, region, objective, or custom id; empty matches any id for that kind.
Definition RTSTypes.h:1374
Authorable trigger: OR of events, AND of variable conditions, then actions.
Definition RTSTypes.h:1414
std::vector< MissionTriggerCondition > conditions
Definition RTSTypes.h:1420
std::vector< MissionTriggerEventFilter > events
Definition RTSTypes.h:1419
std::vector< MissionAction > actions
Definition RTSTypes.h:1421
Named numeric campaign variable.
Definition RTSTypes.h:1449
Complete RTS order projection snapshot; entity handles must be rebound by the owning domain.
Definition RTSTypes.h:393
std::map< std::string, CommandSpec > extended
Definition RTSTypes.h:395
Owning projection of the active generic order used by RTS systems.
Definition RTSTypes.h:122
ecs::EntityHandle targetEntity
Definition RTSTypes.h:127
WorldPosition secondaryTarget
Definition RTSTypes.h:128
std::string definitionId
Definition RTSTypes.h:126
WorldPosition target
Definition RTSTypes.h:125
PlacementLinkTag public API.
Definition RTSTypes.h:307
Authority provider link.
Definition RTSTypes.h:1148
Economy account/provider link.
Definition RTSTypes.h:1152
Event stream/provider link.
Definition RTSTypes.h:1169
Runtime identity.
Definition RTSTypes.h:1142
RTS-owned selection handles; handles are generation checked on use.
Definition RTSTypes.h:1160
std::vector< ecs::EntityHandle > units
Definition RTSTypes.h:1161
std::vector< ecs::EntityHandle > buildings
Definition RTSTypes.h:1162
Social graph/provider link.
Definition RTSTypes.h:1156
Typed RTS definition projected to the common lifecycle schema.
Definition RTSEffects.h:35
ResourceNodeLinkTag public API.
Definition RTSTypes.h:285
Concurrent worker capacity and current generation-checked assignments.
Definition RTSTypes.h:1113
std::vector< ecs::EntityHandle > workers
Definition RTSTypes.h:1115
Runtime and persistent identity.
Definition RTSTypes.h:1094
Authoritative world position and interaction radius.
Definition RTSTypes.h:1100
Authoritative remaining resource stock.
Definition RTSTypes.h:1106
SensingLinkTag public API.
Definition RTSTypes.h:297
Typed link tag for a provider-owned capability or registry entry.
Definition RTSTypes.h:234
SettlementLinkTag public API.
Definition RTSTypes.h:305
SocialLinkTag public API.
Definition RTSTypes.h:313
SteeringLinkTag public API.
Definition RTSTypes.h:299
Ability cooldowns and an optional deterministic cast/channel in progress.
Definition RTSTypes.h:685
std::optional< Channel > channel
Definition RTSTypes.h:698
std::vector< Cooldown > cooldowns
Definition RTSTypes.h:697
Shared action runtime/provider link.
Definition RTSTypes.h:557
Indirect-fire deployment and deterministic area-fire policy.
Definition RTSTypes.h:752
WorldPosition lastFirePosition
Definition RTSTypes.h:771
WorldPosition departedPosition
Definition RTSTypes.h:759
WorldPosition relocationTarget
Definition RTSTypes.h:758
Canonical attribute state.
Definition RTSTypes.h:520
AttributeComponent values
Definition RTSTypes.h:521
Capture contribution while executing a Capture order.
Definition RTSTypes.h:701
RTS stance and pursuit limits used by automatic combat policies.
Definition RTSTypes.h:622
std::map< std::string, float > targetPriorities
Definition RTSTypes.h:640
Command-network policy and derived connection state for a mobile unit or relay.
Definition RTSTypes.h:667
Unit containment state for transports and building garrisons.
Definition RTSTypes.h:705
std::vector< ecs::EntityHandle > occupants
Definition RTSTypes.h:708
Crowd provider link.
Definition RTSTypes.h:544
RuntimeHandle< eve::crowd::CrowdAgentTag > runtimeAgent
Definition RTSTypes.h:548
std::string runtimeBindingKey
Derived cache; never serialized as authority.
Definition RTSTypes.h:550
Logical unit definition identity.
Definition RTSTypes.h:516
Canonical combat durability state consumed by combat::DamageRuntime.
Definition RTSTypes.h:643
combat::CombatState state
Definition RTSTypes.h:644
Lifecycle-only active effects.
Definition RTSTypes.h:528
RTSEffectComponent values
Definition RTSTypes.h:529
Owning faction link.
Definition RTSTypes.h:565
rts::FactionLink link
Definition RTSTypes.h:566
Runtime identity and logical unit definition.
Definition RTSTypes.h:510
std::string displayName
Definition RTSTypes.h:513
Suppression, recovery, retreat policy, and friendly morale aura.
Definition RTSTypes.h:736
Authoritative kinematic state used by the phase-one move slice.
Definition RTSTypes.h:569
RTS projection of a canonical map path; the map provider remains the grid authority.
Definition RTSTypes.h:578
WorldPosition patrolOrigin
Definition RTSTypes.h:583
std::vector< WorldPosition > waypoints
Definition RTSTypes.h:579
std::optional< WorldPosition > formationTarget
Derived moving slot; rebuilt each step, excluded from saves.
Definition RTSTypes.h:591
std::optional< WorldPosition > combatSlotTarget
Derived infantry melee approach slot; expires each step, excluded from saves.
Definition RTSTypes.h:593
WorldPosition plannedGoal
Definition RTSTypes.h:582
std::optional< WorldPosition > trafficRecoveryTarget
Derived evacuation step; does not replace the order.
Definition RTSTypes.h:595
Generic command/order state.
Definition RTSTypes.h:532
OrderComponent values
Definition RTSTypes.h:533
Sensing provider link.
Definition RTSTypes.h:536
Settlement provider link.
Definition RTSTypes.h:561
RTS shield layer consumed before canonical health damage and regenerated deterministically.
Definition RTSTypes.h:648
Steering provider link.
Definition RTSTypes.h:540
Tactical ammunition logistics; weapon ammunition remains authoritative in WeaponEntity.
Definition RTSTypes.h:711
WorldPosition rendezvousPoint
Definition RTSTypes.h:729
WorldPosition returnPoint
Definition RTSTypes.h:728
Escort geometry and combat-group coordination state.
Definition RTSTypes.h:776
SubjectRef escortInterceptTarget
Definition RTSTypes.h:795
Entity-local tags.
Definition RTSTypes.h:524
Upgrade ids already projected onto this unit, preventing repeated multiplicative application.
Definition RTSTypes.h:802
std::vector< std::string > applied
Definition RTSTypes.h:803
Persistent combat experience and deterministic veteran/elite modifiers.
Definition RTSTypes.h:656
Vision contribution projected into a faction-owned canonical map FOV provider.
Definition RTSTypes.h:598
Weapon entity link.
Definition RTSTypes.h:553
Worker gathering and delivery state; balances remain owned by the linked economy account.
Definition RTSTypes.h:610
ResourceNodeLink resourceNode
Definition RTSTypes.h:612
std::string resourceType
Definition RTSTypes.h:611
BuildingLink dropoff
Definition RTSTypes.h:613
WeaponLinkTag public API.
Definition RTSTypes.h:283
Two-dimensional deterministic RTS world position.
Definition RTSTypes.h:53