载入中...
搜索中...
未找到
RTSNavigation.cpp
浏览该文件的文档.
12 const auto found = std::find_if(viewer.intel()->contacts.begin(), viewer.intel()->contacts.end(),
16 const auto contribution = [&](const weapon::WeaponDefinition& definition, WorldPosition source) {
24 auto units = ecs::View<Unit, Unit::Identity, Unit::Motion, Unit::Faction, Unit::Weapon, Unit::Durability,
36 auto buildings = ecs::View<Building, Building::Identity, Building::Placement, Building::Faction, Building::Weapon,
58Result<std::size_t> NavigationSystem::step(map::Pathfinder& pathfinder, const NavigationGrid& grid,
62Result<std::size_t> NavigationSystem::stepSharedFlow(map::Pathfinder& pathfinder, const NavigationGrid& grid,
66Result<std::size_t> NavigationSystem::stepInternal(map::Pathfinder& pathfinder, const NavigationGrid& grid,
81 auto view = ecs::View<Unit, Unit::Identity, Unit::Motion, Unit::Navigation, Unit::Orders, Unit::Containment,
117 const bool supplyMission = record->kind == OrderKind::Resupply || record->kind == OrderKind::SupplyRelay;
122 for (std::size_t index = navigation->waypointIndex; index < navigation->waypoints.size(); ++index) {
125 visibleHostileThreatAt(*viewer, point) * std::hypot(point.x - previous.x, point.y - previous.y);
169 baseline != nullptr && !baseline->empty() && supply->routeThreat + 1e-4f < exposure(baseline.get());
#define EV_PROFILE_MODULE(module, name)
Profile the enclosing scope, tagged with a module for grouping.
Definition Profile.h:158
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
Pathfinding facade. Single-agent: A*. Group (same goal): Flow Field + follow. Grid/topology internals...
Definition Pathfinder.h:62
Path * findPath(int sx, int sy, int gx, int gy)
A* from (sx,sy) to (gx,gy). Returns owned Path* (may be empty if unreachable). Never returns nullptr ...
Definition Pathfinder.cpp:582
RTS building domain root with placement and production composition.
Definition RTSTypes.h:852
static bool isAllied(Faction *left, Faction *right) noexcept
Return true when both live factions are identical or share a team in a common Match.
Definition RTSSystems_Faction.cpp:58
Faction domain root; membership is a set of typed runtime handles.
Definition RTSTypes.h:1192
void worldToCell(const GridConfig &cfg, float px, float py, int &cx, int &cy, int mapW, int mapH)
Maps planar coordinates to the nearest cell. Staggered/hex layouts use a bounded nearest-neighbor sea...
Definition GridProjection.cpp:69
void cellToWorld(const GridConfig &cfg, int cx, int cy, float &px, float &py)
Maps a cell to planar coordinates (px, py). On XY plane these are world (x, y); on XZ plane they are ...
Definition GridProjection.cpp:30
WorldPosition movementGoal(Unit &unit, const OrderRecord &order)
Resolve the current canonical movement goal without retaining entity pointers. @ownership Returns a w...
Definition RTSSystemMovementInternal.h:100
float visibleHostileThreatAt(Faction &viewer, WorldPosition point)
Observe visible hostile weapon threat at a world point using canonical faction intelligence.
Definition RTSNavigation.cpp:9
float distanceSquared(float ax, float ay, float bx, float by)
Definition RTSSystemMovementInternal.h:27
Result< std::optional< OrderRecord > > readCurrent(OrderComponent &orders)
Definition RTSSystemMovementInternal.h:115
bool isMovementOrder(OrderKind kind)
Definition RTSSystemMovementInternal.h:47
std::optional< WorldPosition > entityPosition(const ecs::EntityHandle &handle)
Definition RTSSystemMovementInternal.h:89
bool isSharedFlowNavigationOrder(Unit &unit, const OrderRecord &order)
Whether planning uses the shared policy, before the current group projection exists.
Definition RTSSystemMovementInternal.h:34
Definition RTS.cpp:30
@ SupplyRelay
@ Resupply
std::function< void(Unit &, const OrderRecord &)> NavigationEvent
Notification emitted once when a newly planned order has no canonical map route.
Definition RTSSystems.h:282
WidgetDesc grid(int columns, std::vector< WidgetDesc > children, std::string id)
Fixed-column grid; children are placed in source order.
Definition Widget.cpp:878
@ InvalidArgument
@ NoOp
@ Applied
Construction progress and generation-checked assigned builders.
Definition RTSTypes.h:909
Building health and repair economy configuration.
Definition RTSTypes.h:916
Placement world key and authoritative cell state.
Definition RTSTypes.h:871
Canonical weapon entity used by an armed building.
Definition RTSTypes.h:968
Unit containment state for transports and building garrisons.
Definition RTSTypes.h:705
Canonical combat durability state consumed by combat::DamageRuntime.
Definition RTSTypes.h:643
Authoritative kinematic state used by the phase-one move slice.
Definition RTSTypes.h:569