Behavior class abstract

Base class of a behavior.

A behavior is processed every frame by the BehaviorManager (added by the UseBehavior mixin).

Contract of the return value

process returns true when the behavior is finished (or does not need to keep blocking the sequence), which makes the manager advance to the next behavior. Return false to keep running this behavior, holding the sequence until it finishes.

class MyBehavior extends Behavior {
  @override
  bool process(double dt, GameComponent comp, BonfireGameInterface game) {
    // do something...
    return true; // finished, advance to the next behavior
  }
}
Implementers

Constructors

Behavior({dynamic id})

Properties

hashCode int
The hash code for this object.
no setterinherited
id → dynamic
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process(double dt, GameComponent comp, BonfireGameInterface game) bool
Processes this behavior for the current frame.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited