-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdiagram.puml
293 lines (264 loc) · 6 KB
/
diagram.puml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
'You may preview the uml using www.planttext.com/planttext
@startuml
title LP24 - Dungeon of Legends
skinparam {
nodesep 30
ranksep 51
backgroundcolor #888888
}
enum Direction{
UP
DOWN
LEFT
RIGHT
}
enum ConsumableType{
POT
SCROLL
toString(): String
}
enum WeaponType{
BOW
SWORD
WAND
toString(): String
}
enum ArmorType{
BREAST_PLATE
GLOVES
HELMET
BOOTS
PANTS
toInt(): int
fromInt(a: int): ArmorType
toString(): String
}
enum StorableObjectType{
WEAPON
ARMOR
CONSUMABLE
}
enum LivingThingType{
PLAYER
MOB
}
enum Tile{
WALL
ROOM
CORRIDOR
OPENED_DOOR
CLOSED_DOOR
STAIR_UP
STAIR_DOWN
UNKNOWN
}
LivingThingType -[hidden]right- StorableObjectType
ArmorType -[hidden]left- StorableObjectType
WeaponType -[hidden]left- ArmorType
WeaponType -[hidden]right- ConsumableType
interface StorableObject{
+ getType(): StorableObjectType
+ toString(): String
}
interface Consumable{
+ trigger(livingThing: LivingThing): void
+ nextTick(): boolean
+ getConsumableType(): ConsumableType
}
StorableObject <|-- Consumable
class Armor{
- defensePowerModifier: int
- attackPowerModifier: int
- type: ArmorType
+ Armor(defensePowerModifier, ...)
+ getDefensePowerModifier(): int
+ getAttackPowerModifier(): int
+ getArmorType(): ArmorType
}
Armor -[hidden]up-> StorableObject
Consumable -[hidden]right- Armor
StorableObject <|.. Armor
class Weapon{
- attackPowerModifier: int
- range: byte
- manaCost: byte
- type: WeaponType
+ Weapon(damageModifier, ...)
+ getWeaponType(): WeaponType
+ getAttackPowerModifier(): int
+ getRange(): byte
+ getManaCost(): byte
}
StorableObject <|.. Weapon
class Scroll{
- healthModifierPerTick: int
- healthModifierModifierPerTick: int
- name: String
- turns: byte
+ Scroll(turns, ...)
'For saving purposes
+ getHMPT(): int
+ getHMMPT(): int
}
class Pot{
- healthModifier: int
- defensePowerModifier: int
- attackPowerModifier: int
- name: String
- turns: byte
+ Pot(healthModifier,...)
'For saving purposes
+ getHM(): int
+ getDPM(): int
+ getAPM(): int
}
Pot -[hidden]up-> Consumable
Scroll -[hidden]up-> Consumable
Pot -[hidden]right- Scroll
Consumable <|.. (Pot, Scroll)
abstract class LivingThing{
- sight: Tile[][]
- level: int
- maxHitPoints: int
- hitPoints: int
- attackPower: int
- defensePower: int
- position: Vector2i
- requestedAttack: Direction
- requestedMove: Direction
+ print(): void
+ updateSight(newSight: Tile[][]): void
+ getSight(): Tile[][]
+ getLevel(): int
+ getMaxHitPoints(): int
+ getHitPoints(): int
+ getDamagePower(): int
+ getDefensePower(): int
+ getPosition(): Vector2i
+ getRequestedAttack(): Direction
+ getRequestedMove(): Direction
+ setPosition()
+ damage(): void
+ isAlive(): boolean
+ live(): void
+ getType(): LivingThingType
}
class Player{
- maxStorageCapacity: int
- maxMana: int
- mana: int
- abilityPower: int
- armor[5]: Armor
- weapon: Weapon
- name: String
+ passedStairs: boolean
+ Player(name, ...)
+ getMana(): int
+ addToInventory(storable: StorableObject)
+ useMana(consumption: int): boolean
- equipWith(equiment: Equipement)
'For saving purposes
+ getEquipedArmor(): Armor[5]
+ getEquipedWeapon(): Weapon
+ getInventory(): StorableObject[]
}
Player *-right-> StorableObject
Player -[hidden]up-> LivingThing
class Mob{
+ Mob(attackPower, ...)
- keepPatroling(): void
- chase(): void
- wander(): void
}
Mob -left-> State
Mob -[hidden]right- Player
Mob -[hidden]up-> LivingThing
LivingThing <|-- (Mob, Player)
class Game {
+ launch(numberOfPlayers: byte, ...): void
- Game()
- nextTick(): void
- loadSave(): boolean
- save(): void
}
Game *-up-> Mob
Game "1,2" *-up-> Player
Game --> Map
Game -left-> HUD
class Map {
+ MIN_ROOM_WIDTH: final int
+ MAX_ROOM_WIDTH: final int
+ MIN_ROOM_HEIGHT: final int
+ MAX_ROOM_HEIGHT: final int
+ MIN_LEVEL_HEIGHT: final int;
+ MAX_LEVEL_HEIGHT: final int;
- seed: Seed
- stairsUpPosition: Vector2i
- stairsDownPosition: Vector2i
- map: Tile[][]
+ Map()
+ Map(seed: Seed, stairsUpPosition: Vector2i)
+ triggerTile(position: Vector2i, target: LivingThing): void
+ getStairsUpPosition(): Vector2i
+ getStairsDownPosition(): Vector2i
+ getAlphaSeed(): int
+ getBetaSeed(): int
+ getTile(position: Vector2i): Tile
+ getLOS(position: Vector2i, visionRange: byte): Tile[][]
+ getSize(): Vector2i
+ generateLevel(level: int): void
+ restoreLevel(level: int): void
- isVisibleFrom(tilePosition: Vector2i,watcherPosition: Vector2i) : boolean
- generateLevel(level: int, withEntities: boolean): void
}
Map *--> InteractiveObject
Map *-left-> Tile
Map --> Seed
class Seed {
- alphaSeed: long
- betaSeed: long
+ Seed()
+ Seed(alphaSeed: int, betaSeed: int)
+ getAlphaSeed(): int
+ getBetaSeed(): int
+ getRandomizer(level: int): Random
}
enum State{
PATROLING
STANDING
SLEEPING
WANDERING
CHASING
}
class HUD {
- players: Player[]
+ print(): void
+ setPlayers(players: Player[]): void
}
class InteractiveObject{
- isTrap: boolean
- manaModifier: int
- hpModifier: int
- loot: StorableObject
- target: LivingThingType
- position: Vector2i
+ InteractiveObject(isTrap: boolean, position: Vector2i)
+ getPosition(): Vector2i
+ trigger(LivingThing: LivingThing): boolean
+ isActivableOn(type: LivingThingType): boolean
+ print(): void
}
class Vector2i{
+ x: int
+ y: int
+ Vector2i(x: int, y: int)
+ Vector2i()
+ Vector2i(v: Vector2i)
+ set(x: int, y: int): void
+ equals(vect: Vector2i): boolean
+ add(dir: Direction): void
+ x(): int
+ y(): int
}
Vector2i *-[hidden]right-> LivingThing
@enduml