mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 12:58:37 +00:00
2e7eef136a
* Update CannotSubtractException.java * Update CachingTest.java * Update App.java * Update caching.urm.puml * Update update-method.urm.puml
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
@startuml
|
|
package com.iluwatar.updatemethod {
|
|
class App {
|
|
- GAME_RUNNING_TIME : int {static}
|
|
- LOGGER : Logger {static}
|
|
+ App()
|
|
+ main(args : String[]) {static}
|
|
}
|
|
abstract class Entity {
|
|
# id : int
|
|
# logger : Logger
|
|
# position : int
|
|
+ Entity(id : int)
|
|
+ getPosition() : int
|
|
+ setPosition(position : int)
|
|
+ update() {abstract}
|
|
}
|
|
class Skeleton {
|
|
- PATROLLING_LEFT_BOUNDING : int {static}
|
|
- PATROLLING_RIGHT_BOUNDING : int {static}
|
|
# patrollingLeft : boolean
|
|
+ Skeleton(id : int)
|
|
+ Skeleton(id : int, position : int)
|
|
+ update()
|
|
}
|
|
class Statue {
|
|
# delay : int
|
|
# frames : int
|
|
+ Statue(id : int)
|
|
+ Statue(id : int, delay : int)
|
|
- shootLightning()
|
|
+ update()
|
|
}
|
|
class World {
|
|
- LOGGER : Logger {static}
|
|
# entities : List<Entity>
|
|
# isRunning : boolean
|
|
+ World()
|
|
+ addEntity(entity : Entity)
|
|
- gameLoop()
|
|
- processInput()
|
|
- render()
|
|
+ run()
|
|
+ stop()
|
|
- update()
|
|
}
|
|
}
|
|
World --> "-entities" Entity
|
|
Skeleton --|> Entity
|
|
Statue --|> Entity
|
|
@enduml
|