ActionFlyingGenerals class

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.

Inheritance

Constructors

ActionFlyingGenerals({bool activeCondition = false})

Properties

action ActionDefinition
A function that generates a List<ActionEffect> based on an ActionTrigger passed to it.
finalinherited
activeCondition bool
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.
finalinherited
event ActionEvent
The type of event that will trigger this action.
finalinherited
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.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({ActionEvent? event, ActionCondition? precondition, ActionCondition? condition, ActionDefinition? action}) Action
inherited
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.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
swapConditions() Action
Swaps precondition and condition.
inherited
toString() String
A string representation of this object.
inherited

Operators

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