-
Notifications
You must be signed in to change notification settings - Fork 1
/
diagram.plantuml
236 lines (207 loc) · 5.79 KB
/
diagram.plantuml
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
@startuml
package com.knightwars {
class KnightWars {
create()
render()
dispose()
}
package userInterface {
class Display {
- gameManager : GameManager
+ displayGame()
+ displayMainMenu()
}
class EventHandler {
- actorHUD : GameActorHUD
- gameState : KnightWarsGame
+ handleDrag(posTouchDown : Vector2, posTouchDragged : Vector2)
+ handleTouchUp(lastTouchDown : Vector2, lastTouchUp : Vector2)
}
class GameInputProcessor {
- eventHandler : EventHandler
+ touchDown(screenX : int, screenY : int)
+ touchDragged(screenX : int, screenY : int)
+ touchUp(screenX : int, screenY : int)
}
class GameScreen {
+ render(delta : float)
+ resize(width : int, height : int)
}
class MainMenuScreen {
+ render(delta : float)
+ resize(width : int, height : int)
}
class MainMenuBackground {
+ draw(batch : Batch, parentAlpha : float)
}
class MainMenuBackground {
+ draw(batch : Batch, parentAlpha : float)
}
class EndGameScreen {
+ draw(batch : Batch, parentAlpha : float)
}
package gameActors {
class Arrow {
+ getWidth() : float
+ getHeight() : float
+ getOriginX() : float
+ getOriginY() : float
+ getRotation() : float
}
class GameActorBuildings {
- gameState : KnightWarsGame
+ draw(batch : Batch, parentAlpha : float)
}
class GameActorHUD {
- arrow : Arrow
+ draw(batch : Batch, parentAlpha : float)
+ createArrow(selectedBuildingCoords : Vector2, currentCoords : Vector2)
+ deleteArrow()
}
class GameActorUnit {
- gameState : KnightWarsGame
+ draw(batch : Batch, parentAlpha : float)
}
}
}
package desktop {
class DesktopLauncher {
+ DesktopLauncher()
+ main(arg : String[]) {static}
}
}
package game {
class GameManager {
- game : KnightWarsGame
+ getKnightWarsGame() : KnightWarsGame
+ update(dt : float)
}
class KnightWarsGame {
- map : Map
+ attributeBuildings()
+ getMap() : Map
+ getPlayerBlue() : Player
+ getPlayerNeutral() : Player
+ getPlayerRed() : Player
+ update(dt : float)
}
class YamlParser {
yamlValidity(javaMap : Map<String, Map<String, Integer>>, superClass : Class<?> , objPackage : String)
}
package environment {
abstract class Building {
- owner : Player
+ getCoordinates() : Vector2
+ getDefenseLevel() : float
+ getGoldGeneration() : float
+ getHitPoints() : float
+ getKnights() : int
+ getOwner() : Player
+ isSelected(coordinates : Vector2) : Boolean
+ update(dt : float)
}
class Map {
- buildings : ArrayList<Building>
+ getBuildings() : ArrayList<Building>
+ getSize() : Vector2
+ getUnits() : ArrayList<Unit>
+ sendUnit(departureBuilding : Building, arrivalBuilding : Building, percentage : float)
+ update(dt : float)
}
class MapFactory {
+ createProceduralMap(width : float, height : float, buildings : int, defaultPlayer : Player) : Map {static}
- fileToString(fileName : String) : String {static}
+ importMapFromFile(fileName : String, defaultPlayer : Player) : Map {static}
- isValidPoint(map : Map, point : Vector2) : Boolean {static}
}
class Path {
+ getArrivalPoint() : Vector2
+ getCurrentPosition() : Vector2
+ update(dt : float)
}
class Unit {
- departureBuilding : Building
- destinationBuilding : Building
- owner : Player
- path : Path
+ isArrived(threshold : float) : boolean
+ setSpeed(speed : float)
+ update(dt : float)
}
package players {
class ComputerPlayer
class HumanPlayer
class NeutralPlayer
class Player {
- color : ColorPlayer
+ getColor() : ColorPlayer
+ getGold() : float
+ getName() : String
+ getUnitLevel() : float
+ removeGold(gold : float)
+ upgradeUnits()
}
enum ColorPlayer {
+ BLUE {static}
+ NEUTRAL {static}
+ RED {static}
}
}
package buildings {
class ClassicCastle
class FortifiedCastle
class CitadelCastle1
class ForgeCastle1
class GarrisonCastle1
class MarketCastle1
}
class TroopMovement {
- owner: Player
- departureBuilding : Building
- destinationBuilding : Building
- originalPath : Path
+ removeUnit(unit: Unit)
+ update(dt : float)
}
}
}
}
' knightwars
DesktopLauncher ..> KnightWars: crée
KnightWars ..> Display: crée
KnightWars ..> GameManager: crée
' Frontend
Display ..> GameScreen: affiche
Display ..> MainMenuScreen: affiche
Display ..> EndGameScreen: affiche
MainMenuScreen o-- MainMenuBackground
GameScreen o-- GameActorHUD
GameScreen o-- GameActorBuildings
GameScreen o-- GameActorUnit
GameActorHUD o-- Arrow
GameInputProcessor o-- EventHandler
EventHandler o-- GameActorHUD
' Backend
MapFactory ..> Map: crée
GameManager o-- KnightWarsGame
KnightWarsGame o-- Map
Map o-- Unit
Map o-- TroopMovement
TroopMovement o-- Player
TroopMovement o-- Path
Unit o-- Building
Unit o-- Path
Building o-- Player
Player o-- ColorPlayer
ComputerPlayer --|> Player
NeutralPlayer --|> Player
HumanPlayer --|> Player
ClassicCastle --|> Building
FortifiedCastle --|> Building
CitadelCastle1 --|> Building
ForgeCastle1 --|> Building
GarrisonCastle1 --|> Building
MarketCastle1 --|> Building
' Liens frontend - backend
EventHandler o-- KnightWarsGame
@enduml