cardation
Version:
fundation of card games, card model
29 lines (28 loc) • 807 B
TypeScript
import Card from '../card/Card';
import ICollection from './ICollection';
/**
*
* Abstract class for all collection which implements the serialize method.
*
*/
declare abstract class Collection implements ICollection {
private _cardArray;
getCardArray(): Card[];
/**
* Insert card(s) to the collection.
* @param index where to insert
* @param cards the cards to be inserted
*/
insertCard(index: number, ...cards: Card[]): void;
getDuplicatedCardArray(): Card[];
getLength(): number;
/**
* Push card(s) to the collection.
* @param card card to be push in
* @todo avoid duplicate card object in a collection
*/
pushCard(...card: Card[]): void;
includes(card: Card): boolean;
serialize(): string;
}
export default Collection;