mchess-client/lib/chess_bloc/chess_events.dart
2023-07-03 19:41:12 +02:00

56 lines
1.2 KiB
Dart

import 'package:mchess/utils/chess_utils.dart';
abstract class ChessEvent {}
class ReceivedMove extends ChessEvent {
final ChessCoordinate startSquare;
final ChessCoordinate endSquare;
ReceivedMove({required this.startSquare, required this.endSquare});
}
class ReceivedPromotion extends ChessEvent {
final ChessCoordinate startSquare;
final ChessCoordinate endSquare;
final String piece;
ReceivedPromotion(
{required this.startSquare,
required this.endSquare,
required this.piece});
}
class OwnPieceMoved extends ChessEvent {
final ChessCoordinate startSquare;
final ChessCoordinate endSquare;
final ChessPiece piece;
OwnPieceMoved(
{required this.startSquare,
required this.endSquare,
required this.piece});
}
class OwnPromotionPlayed extends ChessEvent {
final ChessPieceClass pieceClass;
final ChessMove move;
OwnPromotionPlayed({required this.pieceClass, required this.move});
}
class InitBoard extends ChessEvent {
InitBoard();
}
class ColorDetermined extends ChessEvent {
final ChessColor myColor;
ColorDetermined({required this.myColor});
}
class InvalidMovePlayed extends ChessEvent {
final ChessMove move;
InvalidMovePlayed({required this.move});
}