Update Class Diagram authored by Kovács Gergely Zsolt's avatar Kovács Gergely Zsolt
**Model** **Model**
```plantuml ```plantuml
class Simulation @startuml Model
Simulation "1" *-- Company skinparam classAttributeIconSize 0
package Model.Common {
interface IDisplayable {
+ getPosition() : Vector2
+ getVisible() : bool
}
interface ITickable {
+ tick()
}
interface IInspectable {
+ getProperties()
}
class Singleton {
- {static} instance : Singleton
- Singleton()
+ {static} getInstance() : Singleton
}
}
Singleton <|-- Simulation
class Simulation {
- people : Person[]
- Simulation()
}
Simulation --> Park
Singleton <|-- Park
IInspectable <|-- Park
class Park {
- balance : int
- entryFee : int
- buildings : Building[]
- Park()
+ getBalance() : int
+ getEntryFee() : int
+ getBuildings() : Building[]
+ modifyBalance(int)
+ addBuilding(Building)
+ setEntryFee(int)
}
IDisplayable <|-- WorldEntity
class WorldEntity {
- position : Vector2
- visible : bool
# WorldEntity(Vector2)
+ getPosition() : Vector2
+ getVisible() : bool
+ setPosition(Vector2)
+ setVisible(bool)
}
Simulation *-- "-people\n*" Person
IInspectable <|--- Person
ITickable <|--- Person
WorldEntity <|-- Person
class Person {
- destination : MapObject
- nextPosition : Vector2
- speed : float {readonly}
- pavement : Pavement
- routeHandle : RouteHandle
# Person(Vector2, float)
+ tick() {override}
+ getProperties() {override}
+ getDestination()
+ setDestination(MapObject)
}
Person <|-- Visitor Person <|-- Visitor
class Visitor {
- mood : int
- satiety : int
- money : int
- inQueue : bool
+ Visitor(Vector2, float, int, int, int)
- chooseDestination()
+ deliverEffects(int, int, int)
+ gameEnded(Vector2)
+ tick() {override}
+ getProperties() {override}
+ modifyMood(int)
+ modifySatiety(int)
+ modifyMoney(int)
+ setInQueue(bool)
}
Person <|-- Staff Person <|-- Staff
class Staff {
- idle : bool
# Staff(Vector2, float)
+ tick() {override}
+ getProperties() {override}
+ isIdle() : bool
+ setDestination(MapObject) {override}
}
Staff <|-- CleaningLady Staff <|-- CleaningLady
class CleaningLady {
+ CleaningLady(Vector2, float)
+ tick() {override}
+ getProperties() {override}
}
Staff <|-- MaintenanceGuy Staff <|-- MaintenanceGuy
Simulation "*" *-- Person
class MaintenanceGuy {
+ MaintenanceGuy(Vector2, float)
+ tick() {override}
+ getProperties() {override}
}
Singleton <|-- MaintenanceDispatcher
Simulation ---> MaintenanceDispatcher
class MaintenanceDispatcher {
- maintainers : MaintenanceGuy[]
- MaintenanceDispatcher()
+ {static} gameBroken(Building)
}
MaintenanceDispatcher *--- "-maintainers\n*" MaintenanceGuy
Simulation "1" *-- Map Simulation "1" *-- Map
WorldEntity <|-- MapObject
class MapObject class MapObject
MapObject <|-- Building MapObject <|-- Building
MapObject <|-- Pavement MapObject <|-- Pavement
...@@ -21,13 +158,4 @@ Pavement <|-- VirtualPavement ...@@ -21,13 +158,4 @@ Pavement <|-- VirtualPavement
Map "*" *-- MapObject Map "*" *-- MapObject
Map "1" *-- NavigationGraph Map "1" *-- NavigationGraph
Simulation "1" *-- MaintenanceDispatcher @enduml```
``` \ No newline at end of file
**Model.Common**
```plantuml
class Vec2D {
+ operator+(Vec2D other)
+ operator-(Vec2D other)
}
```
\ No newline at end of file