RegionEffect class

Defines an effect that a region will have on a piece type.

Constructors

RegionEffect({String? whiteRegion, String? blackRegion, PieceType? pieceType, bool restrictMovement = false, bool winGame = false})
const
RegionEffect.changePiece({String? whiteRegion, String? blackRegion, required PieceType pieceType})
An effect that causes the piece to change to a different type when within the region.
factory
RegionEffect.fromJson(Map<String, dynamic> json)
factory
RegionEffect.movement({String? white, String? black})
An effect that restricts the movement of the piece to within the region.
factory
RegionEffect.winGame({String? white, String? black})
factory

Properties

blackRegion String?
Corresponds to a BoardRegion.id.
final
hashCode int
The hash code for this object.
no setterinherited
pieceType PieceType?
If a piece type is provided, it will replace the piece this effect belongs to whenever the piece is in the region.
final
restrictMovement bool
If true, pieces with this region effect applied to them will not be able to leave the region.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
whiteRegion String?
Corresponds to a BoardRegion.id.
final
winGame bool
If true, a piece with this region effect entering this region will win the game.
final

Methods

copyWith({String? whiteRegion, String? blackRegion, PieceType? pieceType, bool? restrictMovement, bool? winGame}) RegionEffect
normalise(BoardSize size) RegionEffect
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
regionForPlayer(int player) String?
Returns whiteRegion for white and blackRegion for black.
toJson({bool verbose = false}) Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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