mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 20:58:35 +00:00
1a14fa4f40
* update the explanation in README.md * #556 update initial files * added README to component design pattern * Rearrange the file * Finalize the directory * Add test sample * Update the title for README.md * Update the title for README.md * Update the title for README.md * Update the title for README.md * Finish the component design pattern * Updated comments and docstrings for component DP, added basic tests for App and GameObject java classes. Slight modifications to pom.xml to reflect the test suite introduction. * updated comments/docstrings for all classes - wrote v1 of README.md for component design pattern. This still requires the class diagram sketch. * Update the UML and linked with the README.md * Update the README.md * Remove the additional update method and rearrange the file based on the CheckStyle plugin * Changed the structure based on the code smells feedback from PR * Documentation update - uml * Documentation update - grammar * Updated readme to reflect the use of the LOGGER instead of the system output prints. * Correct the constant name * Uses Lombok to remove getter/setter boilerplate * Rename the constant name * Branch out from master and finish all the review changes * Correct the CheckStyle warning Co-authored-by: Samman Palihapitiya Gamage <u7287889@anu.edu.au> Co-authored-by: SammanPali <110753804+SammanPali@users.noreply.github.com>
77 lines
1.3 KiB
Plaintext
77 lines
1.3 KiB
Plaintext
@startuml
|
|
class App
|
|
class GameObject
|
|
|
|
interface GraphicComponent
|
|
interface InputComponent
|
|
interface PhysicComponent
|
|
|
|
class ObjectGraphicComponent
|
|
class DemoInputComponent
|
|
class PlayerInputComponent
|
|
class ObjectPhysicComponent
|
|
|
|
GraphicComponent <|.. ObjectGraphicComponent
|
|
InputComponent <|.. DemoInputComponent
|
|
InputComponent <|.. PlayerInputComponent
|
|
PhysicComponent <|.. ObjectPhysicComponent
|
|
|
|
GameObject *-- ObjectGraphicComponent
|
|
GameObject *.. DemoInputComponent
|
|
GameObject *.. PlayerInputComponent
|
|
GameObject *-- ObjectPhysicComponent
|
|
class App {
|
|
+main(String[] args)
|
|
}
|
|
|
|
class GameObject{
|
|
- inputComponent;
|
|
- physicComponent;
|
|
- graphicComponent;
|
|
- name;
|
|
- velocity
|
|
- coordinate
|
|
|
|
+GameObject()
|
|
+createPlayer()
|
|
+createNpc()
|
|
+demoUpdate()
|
|
+update(e:int)
|
|
+getName()
|
|
+getVelocity()
|
|
+setVelocity(acceleration:int)
|
|
+getCoordinate()
|
|
+setCoordinate()
|
|
}
|
|
|
|
interface GraphicComponent{
|
|
+update()
|
|
}
|
|
|
|
interface InputComponent{
|
|
+update()
|
|
}
|
|
|
|
interface PhysicComponent{
|
|
+update()
|
|
}
|
|
|
|
class ObjectGraphicComponent{
|
|
+update(gameObject:GameObject)
|
|
}
|
|
|
|
class DemoInputComponent{
|
|
-walkAcceleration
|
|
+update(gameObject:GameObject,e:int)
|
|
}
|
|
|
|
class PlayerInputComponent{
|
|
-walkAcceleration
|
|
+update(gameObject:GameObject,e:int)
|
|
}
|
|
|
|
class ObjectPhysicComponent{
|
|
+update(gameObject:GameObject)
|
|
}
|
|
|
|
@enduml |