Reactivate stream builder and send pre-check messages.

This commit is contained in:
Marco 2022-11-19 11:37:56 +01:00
parent b329cb10ad
commit 42e90f10a6

View File

@ -24,7 +24,7 @@ class ChessBloc extends Bloc<ChessEvent, ChessBoardState> {
Map<ChessCoordinate, ChessPiece> newPosition = {};
ServerConnection.getInstance().send(
"from: ${event.startSquare.toString()} to: ${event.endSquare.toString()}");
'from: ${event.startSquare.toString()} to: ${event.endSquare.toString()}');
newPosition[event.endSquare] = state.position[event.startSquare]!;
newPosition[event.startSquare] = const ChessPiece.none();
@ -40,6 +40,9 @@ class ChessBloc extends Bloc<ChessEvent, ChessBoardState> {
bool preCheckHandler(
PreCheckMove event,
) {
ServerConnection.getInstance().send(
'from: ${event.move.startSquare.toString()} to: ${event.move.endSquare.toString()}');
print('Pretending to check a move before you drop a piece');
return true;
}