Gather.h
Source/MassBattle/Public/Fragments/Gather.h
概述Overview
收集(Gather,拾取战利品)系统的 fragment 集合:配置 FGather(收集半径/高度、战利品过滤查询、最大并发收集数、检测冷却)与运行时状态 FGathering(当前目标战利品列表与检测冷却剩余时间)。
Gather (loot collection) fragment collection: config FGather (gather radius/height, loot filter query, max concurrent collections, detection cooldown) and runtime state FGathering (current target loot list and remaining detection cooldown).
FGather USTRUCT
收集配置 fragment(FA_MassBattleBaseFragment 派生)。默认 bEnable = false。经 MASS_FRAGMENT_ACCEPT_NOT_TRIVIALLY_COPYABLE 声明为不可平凡拷贝(含 FMassBattleQuery 成员)。
Gather config fragment (derived from FA_MassBattleBaseFragment). Defaults bEnable = false. Declared via MASS_FRAGMENT_ACCEPT_NOT_TRIVIALLY_COPYABLE as not-trivially-copyable (contains FMassBattleQuery).
成员变量Members
| 名称Name | 类型Type | 默认值 | 说明Description |
|---|---|---|---|
bEnable | bool | false | 启用收集。Enable gathering. |
GatherRadius | float | 200.0f | 收集半径——此范围内的战利品将被收集。Gather radius — loot within this range will be collected. |
GatherHeight | float | 200.0f | 收集高度(垂直范围)。Gather height (vertical range). |
LootQuery | FMassBattleQuery | — | 战利品过滤查询。Loot filter query. |
MaxConcurrentCollections | int32 | 100 | 最大并发收集数。Max concurrent collections. |
DetectionCooldown | float | 0.5f | 检测冷却时长(秒)。Detection cooldown (seconds). |
FGathering USTRUCT
收集运行时状态 fragment(FA_MassBattleBaseFragment 派生)。由收集处理器逐帧更新:目标战利品实体列表与检测冷却倒计时。经 MASS_FRAGMENT_ACCEPT_NOT_TRIVIALLY_COPYABLE 声明为不可平凡拷贝(含 TArray 成员)。
Gather runtime state fragment (derived from FA_MassBattleBaseFragment), updated per frame by the gather processor: target loot entity list and detection cooldown countdown. Declared via MASS_FRAGMENT_ACCEPT_NOT_TRIVIALLY_COPYABLE as not-trivially-copyable (contains TArray).
成员变量Members
| 名称Name | 类型Type | 默认值 | 说明Description |
|---|---|---|---|
CurrentTargets | TArray<FEntityHandle> | 空empty | 正在收集的目标战利品。Current target loots being collected. |
DetectionCooldownTimeLeft | float | 0.0f | 检测冷却剩余时间。Detection cooldown time left. |
管线角色Pipeline Role
FGather / FGathering 由收集路径读取(grep 验证:MassBattleAgentReactionProcessor、MassBattleAgentTraceProcessor、MassBattleAgentSubsystem 均引用)。反应处理器按 DetectionCooldown 节流检测,查询 LootQuery 过滤的目标战利品写入 CurrentTargets,逐项执行收集。
FGather / FGathering are read by the gather paths (verified by grep: MassBattleAgentReactionProcessor, MassBattleAgentTraceProcessor, MassBattleAgentSubsystem). The reaction processor throttles detection by DetectionCooldown, queries loot filtered by LootQuery into CurrentTargets, and performs each collection.