Move constructor

const Move({
  1. required PlayerType player,
  2. required PieceType piece,
  3. required Position? from,
  4. required Position to,
  5. bool isPromotion = false,
  6. bool isCapture = false,
  7. bool isDrop = false,
  8. String? asKif,
})

Implementation

const Move({
  required this.player,
  required this.piece,
  required this.from,
  required this.to,
  this.isPromotion = false,
  this.isCapture = false,
  this.isDrop = false,
  this.asKif,
})  : assert(!(isPromotion &&
          isDrop)), //a move cannot have isDrop and isPromotion
      assert(isDrop
          ? from == null
          : from !=
              null);