Package com.kraken.api.simulation
Class SimulationState
- java.lang.Object
-
- com.kraken.api.simulation.SimulationState
-
public final class SimulationState extends java.lang.ObjectMutable simulation state optimized for rapid cloning and stepping.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimulationStatecopy()Creates a branch-safe copy of this state.intfindNpcSlotByIndex(int npcIndex)Resolves an internal NPC slot by RuneLite NPC index.intgetNpcAttackRange(int npcSlot)intgetNpcId(int npcSlot)intgetNpcIndex(int npcSlot)Returns captured NPC index for a simulation slot.intgetNpcSize(int npcSlot)net.runelite.api.coords.WorldPointgetNpcWorldPoint(int npcSlot)intgetNpcX(int npcSlot)intgetNpcY(int npcSlot)net.runelite.api.coords.WorldPointgetPlayerWorldPoint()booleanisNpcActive(int npcSlot)booleanisNpcCollidable(int npcSlot)booleanisNpcStopWhenLineOfSight(int npcSlot)voidsetNpcActive(int npcSlot, boolean active)Enables or disables an NPC slot.
-
-
-
Method Detail
-
copy
public SimulationState copy()
Creates a branch-safe copy of this state.Static snapshot metadata is shared; mutable entity arrays are copied.
- Returns:
- deep-enough copy for decision-tree expansion.
-
getPlayerWorldPoint
public net.runelite.api.coords.WorldPoint getPlayerWorldPoint()
- Returns:
- player world position.
-
getNpcIndex
public int getNpcIndex(int npcSlot)
Returns captured NPC index for a simulation slot.- Parameters:
npcSlot- internal slot index.- Returns:
- RuneLite NPC index.
-
getNpcId
public int getNpcId(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- RuneLite NPC id.
-
getNpcSize
public int getNpcSize(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- NPC tile footprint size.
-
getNpcAttackRange
public int getNpcAttackRange(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- NPC attack/LoS range used by simulation.
-
isNpcCollidable
public boolean isNpcCollidable(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- true when NPC overlap should block movement.
-
isNpcStopWhenLineOfSight
public boolean isNpcStopWhenLineOfSight(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- true when NPC movement should stop after gaining player LoS.
-
isNpcActive
public boolean isNpcActive(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- true when the NPC is active in this state.
-
setNpcActive
public void setNpcActive(int npcSlot, boolean active)Enables or disables an NPC slot.- Parameters:
npcSlot- internal slot index.active- active flag.
-
getNpcX
public int getNpcX(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- NPC world x coordinate.
-
getNpcY
public int getNpcY(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- NPC world y coordinate.
-
getNpcWorldPoint
public net.runelite.api.coords.WorldPoint getNpcWorldPoint(int npcSlot)
- Parameters:
npcSlot- internal slot index.- Returns:
- NPC world point.
-
findNpcSlotByIndex
public int findNpcSlotByIndex(int npcIndex)
Resolves an internal NPC slot by RuneLite NPC index.- Parameters:
npcIndex- RuneLite NPC index.- Returns:
- internal slot index, or
-1when not present.
-
-