载入中...
搜索中...
未找到
CombatTarget.cpp
浏览该文件的文档.
10std::vector<CombatTargetCandidate> sortedUnique(std::vector<CombatTargetCandidate> candidates, SubjectRef owner) {
Soft/hard lock-on ownership for action combat.
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
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
bool isValid() const noexcept
Return whether this reference is valid and non-nil.
Definition SubjectRef.h:38
Result< void > forgetTarget(SubjectRef target)
Forget a subject wherever it appears as a target.
Definition CombatTarget.cpp:105
Result< void > registerOwner(SubjectRef owner)
Ensure an owner exists with no target.
Definition CombatTarget.cpp:27
Result< CombatLockState > cycle(SubjectRef owner, const std::vector< CombatTargetCandidate > &candidates)
Cycle soft-lock to the next candidate after the current target.
Definition CombatTarget.cpp:70
Result< CombatLockState > hardLock(SubjectRef owner, SubjectRef target)
Hard-lock onto an explicit target; rejects nil or self.
Definition CombatTarget.cpp:57
Result< CombatLockState > softLock(SubjectRef owner, const std::vector< CombatTargetCandidate > &candidates)
Soft-select the highest-score candidate that is not the owner.
Definition CombatTarget.cpp:41
Result< CombatLockState > clear(SubjectRef owner)
Clear the current target while keeping the owner registered.
Definition CombatTarget.cpp:95
Result< void > unregisterOwner(SubjectRef owner)
Remove one owner and its lock.
Definition CombatTarget.cpp:34
Result< CombatLockState > state(SubjectRef owner) const
Return owning lock state or NotFound.
Definition CombatTarget.cpp:118
Definition ActionDamageSink.cpp:9
@ InvalidArgument
@ NotFound
@ Applied