Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
public static final class AIBrain.Chance
- Object
- AIBrain.Chance
ImplementsAIBrain.Decision
Holds with a chance per tick, drawn from the world’s deterministic
Rng.Constructors
public Chance(int perThousand) | A random check. |
Methods
public boolean decide(AIBrain brain, Actor self, PlatformWorld world) | Whether the transition should fire. |
Inherited methods
Constructor details
Chance
public Chance(int perThousand)A random check.
Parameters
perThousandint- the chance per tick, out of 1000
Method details
decide
public boolean decide(AIBrain brain, Actor self, PlatformWorld world)Whether the transition should fire.
Parameters
brainAIBrain- the brain
selfActor- the actor
worldPlatformWorld- the world
Returns
true to switch