aboutsummaryrefslogtreecommitdiff
path: root/src/types.ts
blob: 82a8bb9ae143f23ab73170226a2af4cc7cb42ef7 (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
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
88
export class TolNode {
	name: string;
	children: TolNode[];
	constructor(name: string, children: TolNode[] = []){
		this.name = name;
		this.children = children;
	}
}
export class TreeNode {
	tolNode: TolNode;
	children: TreeNode[];
	x: number;
	y: number;
	w: number;
	h: number;
	headerSz: number;
	sideArea: SideArea | null;
	tileCount: number;
	constructor(tolNode: TolNode, children: TreeNode[], x=0, y=0, w=0, h=0,
		{headerSz=0, sideArea=null, tileCount=1} = {}){
		this.tolNode = tolNode;
		this.children = children;
		this.x = x;
		this.y = y;
		this.w = w;
		this.h = h;
		this.headerSz = headerSz;
		this.sideArea = sideArea;
		this.tileCount = tileCount;
	}
}
export class LayoutNode {
	name: string;
	children: LayoutNode[];
	x: number;
	y: number;
	w: number;
	h: number;
	headerSz: number;
	contentW: number;
	contentH: number;
	empSpc: number;
	sideArea: SideArea | null;
	constructor(name: string, children: LayoutNode[], x=0, y=0, w=0, h=0,
		{headerSz=0, contentW=0, contentH=0, empSpc=0, sideArea=null as SideArea|null} = {}){
		this.name = name;
		this.x = x;
		this.y = y;
		this.w = w;
		this.h = h;
		this.headerSz = headerSz;
		this.children = children;
		this.contentW = contentW;
		this.contentH = contentH;
		this.empSpc = empSpc;
		this.sideArea = sideArea;
	}
}
export class SideArea {
	x: number;
	y: number;
	w: number;
	h: number;
	sweptLeft: boolean;
	extraSz: number;
	constructor(x: number, y: number, w: number, h: number, sweptLeft: boolean, extraSz: number){
		this.x = x;
		this.y = y;
		this.w = w;
		this.h = h;
		this.sweptLeft = sweptLeft;
		this.extraSz = extraSz;
	}
}
export class LeftoverArea {
	parentX: number;
	parentY: number;
	w: number;
	h: number;
	sweptLeft: boolean;
	constructor(parentX: number, parentY: number, w: number, h: number, sweptLeft: boolean){
		this.parentX = parentX;
		this.parentY = parentY;
		this.w = w;
		this.h = h;
		this.sweptLeft = sweptLeft;
	}
}