aboutsummaryrefslogtreecommitdiff
path: root/src/card_db.js
blob: c37f487223530d27cf5f62c33d91e94cc1dcf376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import ocgBanList from "./ocg_banlist.json";
import cnocgBanList from './cnocg_banlist.json';
import mdBanList from './md_banlist.json';

let cardDb = {};
let altId = {};
let banList = {
    none: {
        ban: [],
        limit: [],
        semiLimit: [],
    },
    ocg: ocgBanList,
    cnocg: cnocgBanList,
    md: mdBanList,
};

function cardLimit(id, env) {
    let lst = banList[env];
    if (lst.ban.includes(id)) return 0;
    if (lst.limit.includes(id)) return 1;
    if (lst.semiLimit.includes(id)) return 2;
    return 3;
}

function setCardDb(d) {
    cardDb = d;
}

function getCardDb() {
    return cardDb;
}

function getAltId() {
    return altId;
}

function setAltId(x) {
    altId = x;
}

export {
    getCardDb,
    setCardDb,
    getAltId,
    setAltId,
    cardLimit,
};