mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-22 22:28:22 +03:00
37 lines
847 B
TypeScript
37 lines
847 B
TypeScript
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<AMCardRecentUse> {
|
|
|
|
/**
|
|
* 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", optional: false}
|
|
}
|
|
}
|
|
|
|
} |