the-game-domain
Version:
Complete domain layer for 'The Game' card game with rich business entities, automatic persistence, action tracking, and advanced game mechanics. Features Game, Player, Card, Deck, Pile entities with repository pattern, turn management, victory/defeat dete
36 lines • 992 B
TypeScript
import { Card } from './Card';
export declare class Deck {
private readonly _id?;
private _cards;
constructor(cards: Card[], _id?: string | undefined);
get cards(): readonly Card[];
get id(): string | undefined;
get size(): number;
get isEmpty(): boolean;
shuffle(): void;
drawCard(): Card | undefined;
drawCards(count: number): Card[];
addCard(card: Card): void;
addCards(cards: Card[]): void;
contains(card: Card): boolean;
peekCards(count?: number): Card[];
equals(other: Deck): boolean;
toString(): string;
toJSON(): {
cards: Array<{
value: number;
id?: string;
}>;
id?: string;
};
static fromJSON(data: {
cards: Array<{
value: number;
id?: string;
}>;
id?: string;
}): Deck;
static createInitialDeck(): Deck;
static createWithCards(cards: Card[], id?: string): Deck;
}
//# sourceMappingURL=Deck.d.ts.map