useGameboardPatrolAgent
useGameboardPatrolAgent(
entity): {active:boolean;currentWaypointIndex:number;loop:boolean;pauseTicks:number;roundsCompleted:number;routeId:string;segmentCosts:number[];targetWaypointIndex:number;waitTicksRemaining:number;waypointKeys:string[]; } |undefined
Defined in: src/react/react.ts:942
Read patrol agent configuration for one actor entity.
Parameters
Section titled “Parameters”entity
Section titled “entity”Entity | null | undefined
Returns
Section titled “Returns”Type Literal
Section titled “Type Literal”{ active: boolean; currentWaypointIndex: number; loop: boolean; pauseTicks: number; roundsCompleted: number; routeId: string; segmentCosts: number[]; targetWaypointIndex: number; waitTicksRemaining: number; waypointKeys: string[]; }
active
Section titled “active”active:
boolean=true
Whether the patrol agent is active.
currentWaypointIndex
Section titled “currentWaypointIndex”currentWaypointIndex:
number=0
Current waypoint index.
loop:
boolean=true
Whether the route loops back to the first waypoint.
pauseTicks
Section titled “pauseTicks”pauseTicks:
number=0
Ticks to wait after reaching each waypoint.
roundsCompleted
Section titled “roundsCompleted”roundsCompleted:
number=0
Number of completed route rounds.
routeId
Section titled “routeId”routeId:
string=''
Route id followed by this patrol.
segmentCosts
Section titled “segmentCosts”segmentCosts:
number[]
Optional movement budget per route segment.
targetWaypointIndex
Section titled “targetWaypointIndex”targetWaypointIndex:
number=-1
Target waypoint index for an in-flight segment.
waitTicksRemaining
Section titled “waitTicksRemaining”waitTicksRemaining:
number=0
Remaining wait ticks before the next segment.
waypointKeys
Section titled “waypointKeys”waypointKeys:
string[]
Ordered route waypoint tile keys.
undefined