forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponent.urm.puml
More file actions
74 lines (74 loc) · 2.2 KB
/
Copy pathcomponent.urm.puml
File metadata and controls
74 lines (74 loc) · 2.2 KB
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
@startuml
package com.iluwatar.component.component.physiccomponent {
class ObjectPhysicComponent {
- LOGGER : Logger {static}
+ ObjectPhysicComponent()
+ update(gameObject : GameObject)
}
interface PhysicComponent {
+ update(GameObject) {abstract}
}
}
package com.iluwatar.component.component.inputcomponent {
class DemoInputComponent {
- LOGGER : Logger {static}
- WALK_ACCELERATION : int {static}
+ DemoInputComponent()
+ update(gameObject : GameObject, e : int)
}
interface InputComponent {
+ update(GameObject, int) {abstract}
}
class PlayerInputComponent {
- LOGGER : Logger {static}
- WALK_ACCELERATION : int {static}
+ PlayerInputComponent()
+ update(gameObject : GameObject, e : int)
}
}
package com.iluwatar.component.component.graphiccomponent {
interface GraphicComponent {
+ update(GameObject) {abstract}
}
class ObjectGraphicComponent {
- LOGGER : Logger {static}
+ ObjectGraphicComponent()
+ update(gameObject : GameObject)
}
}
package com.iluwatar.component {
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
class GameObject {
- coordinate : int
- graphicComponent : GraphicComponent
- inputComponent : InputComponent
- name : String
- physicComponent : PhysicComponent
- velocity : int
+ GameObject(inputComponent : InputComponent, physicComponent : PhysicComponent, graphicComponent : GraphicComponent, name : String)
+ createNpc() : GameObject {static}
+ createPlayer() : GameObject {static}
+ demoUpdate()
+ getCoordinate() : int
+ getGraphicComponent() : GraphicComponent
+ getInputComponent() : InputComponent
+ getName() : String
+ getPhysicComponent() : PhysicComponent
+ getVelocity() : int
+ update(e : int)
+ updateCoordinate()
+ updateVelocity(acceleration : int)
}
}
GameObject --> "-inputComponent" InputComponent
GameObject --> "-graphicComponent" GraphicComponent
GameObject --> "-physicComponent" PhysicComponent
ObjectGraphicComponent ..|> GraphicComponent
DemoInputComponent ..|> InputComponent
PlayerInputComponent ..|> InputComponent
ObjectPhysicComponent ..|> PhysicComponent
@enduml