Skip to content

Conversation

@MateuszNaKodach
Copy link
Owner

No description provided.

MateuszNaKodach and others added 30 commits January 19, 2021 09:40
Add a GiHub Actions workflow to the project. Every time someone wants to merge commit into develop it will try to build application, run tests and upload new files on GitHub Pages. Build and test checks must pass to be able to merge.
* more project settings

* fixes to settings

* add ESLint

* additional checks for ts code
Co-authored-by: lamparina <anna.lamperska@gmail.com>
with some interfaces, types and constances
PiotrRynio and others added 19 commits February 13, 2021 17:04
…to_account_the_King's_check

#43_Moves_a_piece_taking_into_account_the_King's_check
* Imports fix

* Delete unused code line

* Fix merge

Co-authored-by: PiotrWR <pwrynio@gmail.com>
Co-authored-by: Piotr Witold Rynio <41823689+PiotrWR@users.noreply.github.com>

Co-authored-by: Mateusz Nowak <kontakt.mateusznowak@gmail.com>
…abled (#80)

* Add test

* Change turn to avoid error

* Add pawnPromotionWasEnabled event

* Fix tests

* Block move until promotion is done

* Restore tests for check | Merge changes and resolve conflicts

* Update lock file

* Fix bug

* Add missing test case

Co-authored-by: lamparina <anna.lamperska@gmail.com>
* Initiall commit

* Initiall commit

* Add types

* Fix name of pieceMovesNotCausingAllyKingCheck function

* Add first test

* Add second test

* Finishtest

* Add CheckmatedKing variable and isCheckmatedKing function

* Delete last added function: isCheckmatedKing

* After code review | Update tests

* Add empty method in ChessEngine. Add code in move() method

* Fix last commit

* Add new test

* Delete doubled test

* Fix bug in test

* Finish checkmateHasOccurred function,
In progress: is PossibleMoves

* Finish all without cleaning code.

* EsLint CoderReview | Update

* Add tests for Stalemate Has Occurred

* Add type for Stalemate Has Occurred

* Fix | Fix test for Stalemate Has Occurred

* Fix | Fix test from others tasks because this tests had bug with stalemate event

* Finish stalemate event service

* Eslint CodeReview | Update
* Add positive and negative test cases for castling

* CastlingWasDone  - positive cases | Castling not possible while king's exposed to attack

* Disable castling if king or rook has already moved or there is any piece between them

* Refactor ChessEngine

* Return all possible moves from one method

* Rename method

* Fix method name

* Refactor possibleMoves method

Co-authored-by: lamparina <anna.lamperska@gmail.com>
Z podziękowaniem dla @nowakprojects @lamparina @tomdworniczak @Szambelan  za ładne CodeReview poprzedniego taska

* Update | Change Stalemate and fix a small bug in test

* Update | Change type of Stalemate event

* Update | Delete imports

* Update | Delete kingPosition problem
* Create modal window for pawn promotion

* Selected figure to be promoted

* Proba skonczenia zadanka

* Rename modal's css classes

* Promotion modal and it's test

* Changes in modal event

* #76 modal window for pawn promotion - Model

* #76 make promotingOnSquare private again

* #76 remove dead code

* #76 CR fixes

Co-authored-by: Pawel Szambelan <p.szambelan1@gmail.com>
Co-authored-by: lamparina <59768305+lamparina@users.noreply.github.com>
Co-authored-by: lamparina <anna.lamperska@gmail.com>
* First part

* Add bg

* next part

* next part

* next part

* next part
* #70 Tests and draft solution

* #70 Refactor test case

* #70 Apply pawn attack in passing logic

* #70 Remove silly test case

* #70 Add return type to method

* #70 Add test case

* #70 delete unneeded if statement

* #70 refactor

* #70 merge develop

* Add en passant to possibleMoves

* Last fix

Co-authored-by: lamparina <anna.lamperska@gmail.com>
Co-authored-by: lamparina <59768305+lamparina@users.noreply.github.com>
Co-authored-by: lamparina <anna.lamperska@gmail.com>
Co-authored-by: lamparina <anna.lamperska@gmail.com>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>....Our title</title>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bugs_bunny_our_meme.jpg 🤣

Comment on lines +79 to +85
// case 'PawnWasPromoted':
// this.view.afterPromotionPiece(
// this.translateSquareToAlgebraicNotation(event.onSquare),
// event.chosenPiece.name.toLowerCase(),
// event.chosenPiece.side,
// );
// break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warto usuwać zakomentowany kod. Najprawdopodobniej i tak osoba, która będzie rozwijała tę funkcjonalność napisze wszystko od nowa zamiast to odkomentowywać.
Dodatkowo jeśli ktoś będzie potrzebował tego, to z łatwością można do tego wrócić dzięki VCS.

@@ -0,0 +1 @@
export interface GameCommentsView {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Myślę że, tak jak w przypadku zakomentowanego kody, warto usuwać kod, który nie jest nigdzie używany.

Comment on lines +1 to +2
import { Bishop, Chessboard, ChessEngine, King, Knight, Pawn, Queen, Rook, Side, Square, SquareWithPiece } from '../../../src/app/model';
import 'jest-extended';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sortowanie importowanych zależności w kolejności

  1. "zewnętrzne" - tak jak 'jest-extended'
  2. "wewnętrzne" - w tym przypadku Figury
    pozwoli poprawić czytelność i będzie pomocne w przypadku znacznie większych projektów

Comment on lines +114 to +132
const queenPromotion = document.createElement('div');
queenPromotion.classList.add('modal__pawn');
queenPromotion.textContent = 'Queen';
modalPawnWrap.appendChild(queenPromotion);

const rookPromotion = document.createElement('div');
rookPromotion.classList.add('modal__pawn');
rookPromotion.textContent = 'Rook';
modalPawnWrap.appendChild(rookPromotion);

const knightPromotion = document.createElement('div');
knightPromotion.classList.add('modal__pawn');
knightPromotion.textContent = 'Knight';
modalPawnWrap.appendChild(knightPromotion);

const bishopPromotion = document.createElement('div');
bishopPromotion.classList.add('modal__pawn');
bishopPromotion.textContent = 'Bishop';
modalPawnWrap.appendChild(bishopPromotion);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rozważyłbym utworzenie funkcji pomocniczej aby uniknąć duplikowania pewnych części kodu

const pieceImage = divFrom?.firstChild as HTMLImageElement;

if (pieceImage) {
pieceImage.src = `static/img/pieces/${side.toLowerCase()}-${piece.toLowerCase()}.svg`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dobrym pomysłem mogłoby być przechowywanie początka ścieżki (static/img/pieces/) w zmiennej globalnej, na wypadek zmian w strukturze katalogów.
W tym przypadku występuje to także w 83 linijce

Comment on lines +50 to +55
buttonDomElement.classList.remove('button--large');
buttonDomElement.classList.add('button--small');
}
if (this.size == Size.LARGE) {
buttonDomElement.classList.remove('button--small');
buttonDomElement.classList.add('button--large');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tutaj także zastosować enuma, tak jak w przypadku Size.

Copy link

@Nefariusek Nefariusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Organizacja kodu, zastosowanie programowania obiektowego i możliwości jakie daje TypeScript na bardzo wysokim poziomie. Implementacja jest bardzo przejrzysta.
Pochwalić należy także wysokie pokrycie kodu testami.

Podsumowując - super projekt.

@annalamperska
Copy link
Collaborator

Dzięki za review! Chciałam tylko dodać, że już wszystko działa :) Promocja, bicie w przelocie i takie tam ;)

DomiZet and others added 2 commits February 21, 2021 17:34
* Update README.md

Update README file

* Update readme again

* Add live version link and sreenshoots of a game

Co-authored-by: lamparina <59768305+lamparina@users.noreply.github.com>
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.

8 participants