-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.go
46 lines (42 loc) · 975 Bytes
/
state.go
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
package main
import (
"github.com/pezza/advent-of-code/puzzles/2020/Day202024"
"github.com/pezza/advent-of-code/puzzles/common"
)
type state struct {
tiles []tile
currentTime float64
animTick float64
stateTick float64
insIndex int
subInsIndex int
running bool
paused bool
puzzlePart int
automataIteration int
maxIteration int
lastLen int
Day202024.Floor
}
type tile struct {
common.Point
margin int
endTile bool
}
func getNewState(running bool, puzzlePart int) state {
return state{
tiles: make([]tile, 0),
animTick: 0,
stateTick: 0,
currentTime: 0,
insIndex: 0,
subInsIndex: 0,
running: running,
paused: false,
puzzlePart: puzzlePart,
automataIteration: 0,
maxIteration: 100,
lastLen: 0,
Floor: make(Day202024.Floor, 0),
}
}