Action class

Implementers

Constructors

Action({ActionEvent event = ActionEvent.afterMove, ActionCondition? precondition, ActionCondition? condition, required ActionDefinition action})
const
Action.explodeOnCapture(Area area)
factory
Action.explosionRadius(int radius)
factory
Action.flyingGenerals({bool activeCondition = false})
The flying generals rule from Xiangqi. If the generals/kings are facing each other, with no pieces between, the move will be invalidated. Set activeCondition to true if you have other actions that might modify the board before this.
factory

Properties

action ActionDefinition
A function that generates a List<ActionEffect> based on an ActionTrigger passed to it.
final
condition ActionCondition?
The condition is checked before executing the action in its sequence, i.e. effects applied by actions occurring before this in the sequence will be taken into account by the condition, in contrast with precondition.
final
event ActionEvent
The type of event that will trigger this action.
final
hashCode int
The hash code for this object.
no setterinherited
precondition ActionCondition?
The precondition is checked before any action in the group is executed. In other words, the precondition will act on the state of the game, ignoring any changes that happen as a result of actions executed before this one, that are triggered by the same event.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({ActionEvent? event, ActionCondition? precondition, ActionCondition? condition, ActionDefinition? action}) Action
forPieceType(int type) Action
Copies the Action with the added condition that the piece type is type. Used internally when building variants, to enable convenience actions on piece type definitions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
swapConditions() Action
Swaps precondition and condition.
toString() String
A string representation of this object.
inherited

Operators

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