-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonolithicClasses.js
More file actions
88 lines (74 loc) · 1.46 KB
/
Copy pathmonolithicClasses.js
File metadata and controls
88 lines (74 loc) · 1.46 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class BaseCard {
constructor(name, cost, color, type) {
this.name = name;
this.cost = cost;
this.colors = [...colors];
this.type = type;
}
castingSpeed() {
}
}
class Card extends BaseCard {
constructor(name, cost, color, type, rules = []) {
super(name, cost, color, type);
}
}
class TheStack {
constructor(gameState) {
if (!(gameState instanceof GameState)) throw TypeError('TheStack must be constructed with a GameState')
this.gameState = gameState;
this.stack = [];
this.priority = ''; //must be a summoner
}
resolveNext() {
const spell = this.stack.pop();
spell.execute()
}
shiftPriority() {
}
add(card) {
this.stack.push(card);
if (card.isSplitSecond()) {
this.resolveNext();
}
else if ()
}
passPriority() {
this.priority =
}
checkState() {
}
}
class Summoner {
constructor({
name,
life,
poison,
})
}
class GameState {
constuctor(
{
startingLife: 20,
maxPoison: 10,
maxCommander: 21,
minLife: 0,
},
...summoners) {
this.startingLife = startingLife;
this.maxPoison = maxPoison;
this.maxCommander = maxCommander;
this.minLife = minLife;
this.summoners = this.summonerInit(summoners);
}
summonerInit(...summoners) {
return summoners.map(e => new Summoner(Object.assign(
{},
{
name: e,
life: this.startingLife,
});
);
}
}
class G_Commander