-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.ts
More file actions
65 lines (56 loc) · 1.48 KB
/
init.ts
File metadata and controls
65 lines (56 loc) · 1.48 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
import Data from '../src/data/dataController';
import Costs from '../src/utils/costController';
import FactionList from '../src/lists/factionList';
import UnitList from '../src/lists/unitList';
import ArmyList from '../src/lists/armyList';
import Editor from '../src/editor/editor';
export default class ListBuilder {
public data: Data;
public costs: Costs;
public factionList: FactionList;
public unitList: UnitList;
public armyList: ArmyList;
public editor: Editor;
constructor() {
this.costs = new Costs();
this.factionList = new FactionList();
this.unitList = new UnitList();
this.armyList = new ArmyList();
this.editor = new Editor();
this.data = new Data(this.setup, this.loadingFailure);
}
public loadFactionData() {
this.data.loadFactionData();
}
public setup() {
window.list.costs.init();
window.list.factionList.init();
}
public loadingFailure() {
alert('Faction data failed to load :(');
}
}
let list = new ListBuilder();
list.loadFactionData();
declare global {
interface Window {
list: ListBuilder;
}
}
window.list = list;
/**
* X 1. Load all the supported faction files
* X 2. Create the cost header
* X 3. Create the faction list
* X 4. Create the army list
* X 5. Create the available unit list
* X 6. Populate the army list
* 7. Create the editor
*
* TODOs:
* - Spells
* - Strategems
* - Detachments
* - Warlord traits
* - A way to tell which weapon goes with which model in print view
*/