Skip to content

Commit

Permalink
✨ feat(app): restored ability to add cards to the board
Browse files Browse the repository at this point in the history
  • Loading branch information
drackp2m committed Oct 30, 2024
1 parent 3676496 commit a3f7824
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions apps/app/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export default [
{
files: ['**/*.html'],
rules: {
'sonarjs/no-element-overwrite': 'off',
'sonarjs/no-same-line-conditional': 'off',
'sonarjs/no-unenclosed-multiline-block': 'off',
'prettier/prettier': 'warn',
'@angular-eslint/template/click-events-have-key-events': 'warn',
'@angular-eslint/template/interactive-supports-focus': 'warn',
Expand Down
14 changes: 9 additions & 5 deletions apps/app/src/app/page/game/store/game.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export const GameStore = signalStore(
patchState(store, initialState);
},
newGame(): void {
const boardCards = gameService.getNewCards(store.boardCards(), 12);
const boardCards = gameService.getNewCards(store.boardCards(), 9);

patchState(store, { boardCards });
patchState(store, { ...initialState, boardCards });

this._searchSetOnBoard();
},
Expand Down Expand Up @@ -73,9 +73,13 @@ export const GameStore = signalStore(
patchState(store, { wrongSetCards: [...wrongSetCards, null, null, null] });
},
addCardsToBoard(): void {
for (let i = 0; i < 3; i++) {
// this.boardCards.update((cards) => [...cards, this.getValidCard()]);
}
const boardCards = store.boardCards();

const newCards = gameService.getNewCards(boardCards, 3);

patchState(store, { boardCards: [...boardCards, ...newCards] });

this._searchSetOnBoard();
},
_searchSetOnBoard(): void {
const boardCards = store.boardCards();
Expand Down
2 changes: 1 addition & 1 deletion libs/api-definitions/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import parser from 'jsonc-eslint-parser';

import baseConfig from '../../eslint.config.mjs';

export default [
Expand All @@ -24,7 +25,6 @@ export default [
languageOptions: {
parser: parser,
},

rules: {
'@nx/dependency-checks': 'error',
},
Expand Down

0 comments on commit a3f7824

Please sign in to comment.