ChessNut/engine/core/team.js
2025-10-18 16:21:37 +02:00

28 lines
No EOL
564 B
JavaScript

import Piece, { PieceColor } from './piece.js';
import Hand from './hand.js';
class Team {
/**
* @param {PieceColor} color
* @param {Piece} king
*/
constructor(color, king) {
/** @type {PieceColor} */
this.color = color;
/** @type {Piece} */
this.king = king;
/** @type {Hand} */
this.hand = new Hand();
/** @type {boolean} */
this.hasMadeAction = false;
}
/**
* @returns {boolean}
*/
hasKing() {
return this.king !== null;
}
}
export default Team;