public class Decorator extends BehaviorGoalAdapter
Behavior
, which can add functionality such as filtering
BehaviorStatus
es, conditions, timer loops and more without knowing the internals of the behavior it wraps.
Note that there are often simpler alternatives to a full-blown decorator, which has to be generic for many different
scenarios.Modifier and Type | Class and Description |
---|---|
static class |
Decorator.Builder |
Modifier and Type | Method and Description |
---|---|
void |
reset()
Resets the goal and any resources or state it is holding.
|
BehaviorStatus |
run()
Ticks the behavior, optionally changing the state that it is in.
|
boolean |
shouldExecute() |
static Decorator.Builder |
wrapping(Behavior toWrap) |
create, run, shouldExecute
public void reset()
Goal
public BehaviorStatus run()
Behavior
public boolean shouldExecute()
public static Decorator.Builder wrapping(Behavior toWrap)
Copyright © 2021. All rights reserved.