generated from CodersCamp2020/CodersCamp2020.Project.TypeScript.Chess
-
Notifications
You must be signed in to change notification settings - Fork 3
View checkmate #90
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
Open
tomaszdworniczak
wants to merge
28
commits into
develop
Choose a base branch
from
view_checkmate
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
View checkmate #90
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
1ef27f7
Initiall commit
PiotrRynio c633f1d
Initiall commit
PiotrRynio c673194
Merge branch 'develop' of https://github.com/nowakprojects/CodersCamp…
PiotrRynio b2b8351
Add types
PiotrRynio 57e074b
Fix name of pieceMovesNotCausingAllyKingCheck function
PiotrRynio ce1fc69
Add first test
PiotrRynio bb1f3a8
Add second test
PiotrRynio 1d09bc6
Finishtest
PiotrRynio 713ccd2
Add CheckmatedKing variable and isCheckmatedKing function
PiotrRynio dfb6efe
Delete last added function: isCheckmatedKing
PiotrRynio 44415a3
After code review | Update tests
PiotrRynio ba8c80f
Add empty method in ChessEngine. Add code in move() method
PiotrRynio d9fd09e
Fix last commit
PiotrRynio c31d00d
Add new test
PiotrRynio 609eb8b
Delete doubled test
PiotrRynio fc29bc5
Fix bug in test
PiotrRynio 1562c78
Finish checkmateHasOccurred function,
PiotrRynio fcb270a
Finish all without cleaning code.
PiotrRynio ec6860d
EsLint CoderReview | Update
PiotrRynio b1424ac
Add tests for Stalemate Has Occurred
PiotrRynio 4d6a243
Add type for Stalemate Has Occurred
PiotrRynio 1174cc2
Fix | Fix test for Stalemate Has Occurred
PiotrRynio 31a136b
Fix | Fix test from others tasks because this tests had bug with stal…
PiotrRynio 001b7d3
Finish stalemate event service
PiotrRynio dc3a922
Eslint CodeReview | Update
PiotrRynio 054048b
Solution of end game, service of check mate and display of game resul…
tomaszdworniczak e2a5755
Merge branch 'develop' of https://github.com/nowakprojects/CodersCamp…
tomaszdworniczak 7d9f104
#71 Implement checkmate service, display end game window
tomaszdworniczak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| .endGame { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| height: 200px; | ||
| width: 500px; | ||
| background-image: url('../static/img/papirus-background.png'); | ||
| background-size: cover; | ||
| background-repeat: no-repeat; | ||
| background-position: center; | ||
| position: absolute; | ||
| top: calc(50vh - 100px); | ||
| left: calc(50vw - 250px); | ||
| &__text { | ||
| text-align: center; | ||
| font-size: 3rem; | ||
| font-family: $font-family--primary; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -86,4 +86,20 @@ export class WebChessView implements ChessBoardView { | |||||||||||||||||||||||||
| newPieceElement.src = pieceImage; | ||||||||||||||||||||||||||
| return newPieceElement; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| showEndGameWindow(side: string, position: string): void { | ||||||||||||||||||||||||||
| //TODO zbudować ładne okno z wyświetleniem wyniku | ||||||||||||||||||||||||||
| const endGameModal = document.createElement('div'); | ||||||||||||||||||||||||||
| endGameModal.classList.add('endGame'); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const endGameText = document.createElement('div'); | ||||||||||||||||||||||||||
| endGameText.classList.add('endGame__text'); | ||||||||||||||||||||||||||
| if (side && position) { | ||||||||||||||||||||||||||
| endGameText.innerText = `${side} player lost! Checkmate on ${position}.`; | ||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||
| endGameText.innerText = `Draw!`; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
Comment on lines
+96
to
+101
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
| endGameModal.appendChild(endGameText); | ||||||||||||||||||||||||||
| this.parent.appendChild(endGameModal); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.