mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-18 13:26:03 +00:00
refactor: minor update
This commit is contained in:
@@ -0,0 +1,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
|
||||
Reference in New Issue
Block a user