import {Realm} from "realm"; import {AMCard} from "./AMCard"; /** * Represents a usage of a card for determining which card was last used on a specific game. */ export class AMCardRecentUse extends Realm.Object { /** * The game id that is being tracked */ gameId: string; /** * The card that was last used on the game. * If the card is removed, this record will also be removed. */ card: AMCard; static generate(gameId: string, card: AMCard) { return { gameId: gameId, card: card }; } static schema: Realm.ObjectSchema = { name: "cardUsageHistory", primaryKey: "gameId", properties: { gameId: "string", card: {type: "object", objectType: "card"} } } }