Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Support premove #223

wants to merge 17 commits into from

Conversation

lorenzhh
Copy link
Collaborator

No description provided.

this.engineFacade.dragEndStrategy.process(
event,
this.engineFacade.moveDone,
piece === lastMove?.piece && length !== this.dragStartHistoryLength,
Copy link
Collaborator Author

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

  1. If I dragdown a piece, and a move was done by opponent or bot, it piece I dragged down freezes

  2. 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);
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant