-
Notifications
You must be signed in to change notification settings - Fork 15
/
Homemade.kt
59 lines (54 loc) · 1.64 KB
/
Homemade.kt
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
package co.zsmb.villagedsl.advanced.nodsl.homemade
import co.zsmb.villagedsl.advanced.models.Gold
import co.zsmb.villagedsl.advanced.models.House
import co.zsmb.villagedsl.advanced.models.Person
import co.zsmb.villagedsl.advanced.models.Shield
import co.zsmb.villagedsl.advanced.models.Sword
import co.zsmb.villagedsl.advanced.models.Village
fun main() {
val village = Village(listOf(
House(listOf(
Person(
name = "Alice",
age = 31
),
Person(
name = "Bob",
age = 45
)
), listOf(
Gold(
amount = 500
)
)),
House(listOf(), listOf(
Sword(
strength = 24.2
),
Sword(
strength = 16.7
),
Shield(
defense = 15.3
)
)),
House(listOf(), listOf()),
House(listOf(
Person(
name = "Charles",
age = 52
)
), listOf(
Gold(
amount = 2500
),
Sword(
strength = 0.0
),
Shield(
defense = 0.0
)
))
))
print(village)
}