-
Notifications
You must be signed in to change notification settings - Fork 0
/
life-classes.uml
86 lines (72 loc) · 1.8 KB
/
life-classes.uml
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
@startuml
'-----------------------------------------------------------------------
' Colors and fonts
skinparam defaultFontName "DejaVu Sans Mono"
'-----------------------------------------------------------------------
class Life {
-{static} readConfig(filename: string): Gen
+{static} main(args: string[*]): void
}
class Gen {
+Gen(size: int)
+next(): Gen
+size(): int
+live(x: int, y: int): boolean
+set(x:int, y: int, live: boolean): void
}
class LifeHistory {
+LifeHistory(pattern: Gen)
+evolve(): void
+undo(): void
+current(): Gen
+endOfGame(): boolean
}
class LifeView {
+LifeView(h: LifeHistory)
+setListener(l: LifeViewListener): void
+updateShowPaused(show: boolean): void
+update(): void
}
class LifeController {
+LifeController(h: LifeHistory, v: LifeView)
+tick(): void
}
interface LifeViewListener {
+pause(): void
+resume(): void
+step(): void
+undo(): void
+quit(): void
}
package stdlib {
class Draw {
+Draw(title: string)
+addListener(l: DrawListener): void
+enableDoubleBuffering(): void
+clear(): void
+setPenColor(color: int): void
+filledSquare(x: double, y: double, h: double): void
+square(x: double, y: double, h: double): void
+text(x: double, y: double, t: string): void
+textRight(x: double, y: double, t: string): void
+show(): void
}
class In {
+In(filename: string)
+readInt(): int
+readAllInts(): int[*]
...
}
interface DrawListener {
+keyTyped(c: char c): void
+mousePressed(x: double, y: double): void
+mouseDragged(x: double, y: double): void
+mouseReleased(x: double, y: double): void
+mouseClicked(x: double, y: double): void
+keyPressed(keycode: int): void
+keyReleased(keycode: int): void
}
}
' Life .left.> In: use
' LifeView -left- Draw
@enduml