-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support premove #223
base: master
Are you sure you want to change the base?
Support premove #223
Conversation
this.engineFacade.dragEndStrategy.process( | ||
event, | ||
this.engineFacade.moveDone, | ||
piece === lastMove?.piece && length !== this.dragStartHistoryLength, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing multiple bugs
When to detect on dragEnd if a move was done or not
-
If I dragdown a piece, and a move was done by opponent or bot, it piece I dragged down freezes
-
Comparing the last move piece with the dragged down piece:
What if you predict the next move, and you drag it down, and it really gets moved, it does get frozen
-> To resolve this, I had to implement disable drag of opponent pieces (Not elegeant but fine)
} | ||
possibleMoves = MoveUtils.findPieceByPossibleMovesContaining( | ||
MoveUtils.formatSingle(destPoint, board.reverted), | ||
board, | ||
sourcePiece.color | ||
).filter(piece => piece.constructor.name === sourcePiece.constructor.name); | ||
).filter((piece) => piece.constant.name === sourcePiece.constant.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor name on production gets changed. Use constant name
No description provided.