Goal class
Base class for representing a goal in context of Goal-driven agent design.
@author {@link https://github.com/Mugen87|Mugen87}
- Implementers
Constructors
- Goal([GameEntity? owner])
- Constructs a new goal.
Properties
- active → bool
-
Returns true if the status of this goal is ACTIVE.
no setter
- completed → bool
-
Returns true if the status of this goal is COMPLETED.
no setter
- failed → bool
-
Returns true if the status of this goal is FAILED.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- inactive → bool
-
Returns true if the status of this goal is INACTIVE.
no setter
- owner ↔ GameEntity?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status ↔ GoalStatus
-
getter/setter pair
Methods
-
activate(
) → void - Executed when this goal is activated.
-
activateIfInactive(
) → Goal - Ensures the goal is activated if it is inactive.
-
execute(
) → void - Executed in each simulation step.
-
fromJSON(
Map< String, dynamic> json) → Goal - Restores this instance from the given JSON object.
-
handleMessage(
Telegram telegram) → bool - Goals can handle messages. Many don't though, so this defines a default behavior
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replanIfFailed(
) → Goal - Ensures the goal is replanned if it has failed.
-
resolveReferences(
Map< String, GameEntity> entities) → Goal - Restores UUIDs with references to GameEntity objects.
-
terminate(
) → void - Executed when this goal is satisfied.
-
toJSON(
) → Map< String, dynamic> - Transforms this instance into a JSON object.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited