mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-25 07:38:17 +03:00
28 lines
847 B
TypeScript
28 lines
847 B
TypeScript
import {Realm} from "realm";
|
|
import {AmusementICVendor, ICType} from "../lib/iccard";
|
|
|
|
/**
|
|
* Holds physical card information when a card is imported via NFC/FeliCa
|
|
*/
|
|
export class AMPhysicalCardData extends Realm.Object<AMPhysicalCardData> {
|
|
|
|
cardIDm: string;
|
|
cardType: ICType;
|
|
cardVendor: AmusementICVendor | null;
|
|
|
|
get isBootlegAmusementCard() {
|
|
// real cards have an IDm manufacturer code of 012E (first two bytes of the IDm or in this case, the first 4 characters)
|
|
return this.cardType === ICType.Amusement && !this.cardIDm.startsWith("012E");
|
|
}
|
|
|
|
static schema: Realm.ObjectSchema = {
|
|
name: "physicalCard",
|
|
primaryKey: "cardIDm",
|
|
|
|
properties: {
|
|
cardIDm: "string",
|
|
cardType: "int",
|
|
cardVendor: {type: "int", optional: true}
|
|
}
|
|
};
|
|
} |