exports corrects

This commit is contained in:
Didictateur 2025-10-18 14:30:09 +02:00
parent ce1300bbfe
commit 15208d0bab
9 changed files with 34 additions and 18 deletions

View file

@ -2,15 +2,6 @@ import Cell from './cell.js';
import * as Movement from './movement/index.js'; import * as Movement from './movement/index.js';
import Piece, { PieceColor, PieceType } from './piece.js'; import Piece, { PieceColor, PieceType } from './piece.js';
export default {
Cell,
Movement,
Piece,
PieceColor,
PieceType,
Board
};
/** /**
* Represents the game board. * Represents the game board.
*/ */
@ -93,4 +84,13 @@ class Board {
this.setPiece(3, 7, new Piece(PieceColor.BLACK, PieceType.QUEEN, [Movement.QueenMove])); this.setPiece(3, 7, new Piece(PieceColor.BLACK, PieceType.QUEEN, [Movement.QueenMove]));
this.setPiece(4, 7, new Piece(PieceColor.BLACK, PieceType.KING, [Movement.KingMove])); this.setPiece(4, 7, new Piece(PieceColor.BLACK, PieceType.KING, [Movement.KingMove]));
} }
} }
export default {
Cell,
Movement,
Piece,
PieceColor,
PieceType,
Board
};

View file

@ -9,4 +9,6 @@ class Card {
/** @type {Effect} */ /** @type {Effect} */
this.effect; this.effect;
} }
} }
export default Card;

View file

@ -6,4 +6,6 @@ class Cell {
/** @type {Piece|null} */ /** @type {Piece|null} */
this.piece = piece; this.piece = piece;
} }
} }
export default Cell;

View file

@ -1,3 +1,5 @@
class Effect { class Effect {
constructor() {} constructor() {}
} }
export default Effect;

View file

@ -59,4 +59,6 @@ class GameState {
const team = color === PieceColor.WHITE ? this.whiteTeam : this.blackTeam; const team = color === PieceColor.WHITE ? this.whiteTeam : this.blackTeam;
return team.hasKing(); return team.hasKing();
} }
} }
export default GameState;

View file

@ -26,4 +26,6 @@ class Hand {
return c; return c;
} }
} }
} }
export default Hand;

View file

@ -44,4 +44,6 @@ class Piece {
getType() { getType() {
return this.type; return this.type;
} }
} }
export default Piece;

View file

@ -45,4 +45,6 @@ class Stack {
[this.stack[index], this.stack[randomIndex]] = [this.stack[randomIndex], this.stack[index]]; [this.stack[index], this.stack[randomIndex]] = [this.stack[randomIndex], this.stack[index]];
} }
} }
} }
export default Stack;

View file

@ -24,4 +24,6 @@ class Team {
hasKing() { hasKing() {
return this.king !== null; return this.king !== null;
} }
} }
export default Team;