Update Class Diagram authored by Pőcze Barnabás's avatar Pőcze Barnabás
...@@ -18,23 +18,19 @@ package Model.Common { ...@@ -18,23 +18,19 @@ package Model.Common {
+ GetActions() : IEnumerable<Action> + GetActions() : IEnumerable<Action>
} }
class Singleton { class Singleton<T> {
- {static} instance : T - {static} instance : T
- Singleton() - Singleton()
+ {static} GetInstance() : T + {static} GetInstance() : T
} }
Singleton <|-- Simulation
class Simulation { class Simulation {
- people : Person[] - people : Person[]
- Simulation() - Simulation()
} }
Simulation --|> Singleton
Simulation --> Park Simulation --> Park
Singleton <|-- Park Simulation ---> MaintenanceDispatcher
IInspectable <|-- Park
class Park { class Park {
- balance : int - balance : int
...@@ -48,8 +44,8 @@ package Model.Common { ...@@ -48,8 +44,8 @@ package Model.Common {
+ AddBuilding(Building) + AddBuilding(Building)
+ SetEntryFee(int) + SetEntryFee(int)
} }
Park --|> Singleton
IDisplayable <|-- WorldEntity Park --|> IInspectable
class WorldEntity { class WorldEntity {
- position : Vector2 - position : Vector2
...@@ -60,19 +56,18 @@ package Model.Common { ...@@ -60,19 +56,18 @@ package Model.Common {
+ SetPosition(Vector2) + SetPosition(Vector2)
+ SetVisible(bool) + SetVisible(bool)
} }
WorldEntity --|> IDisplayable
Singleton <|-- MaintenanceDispatcher
Simulation ---> MaintenanceDispatcher
class MaintenanceDispatcher { class MaintenanceDispatcher {
- maintainers : MaintenanceGuy[] - maintainers : MaintenanceGuy[]
- MaintenanceDispatcher() - MaintenanceDispatcher()
+ {static} GameBroken(Building) + {static} GameBroken(Building)
} }
MaintenanceDispatcher --|> Singleton
} }
package Model.Nav { package Model.Map {
package Nav {
class NavigationGraph { class NavigationGraph {
+ AddVertex() : VertexHandle + AddVertex() : VertexHandle
+ AddEdge(VertexHandle, VertexHandle) + AddEdge(VertexHandle, VertexHandle)
...@@ -88,19 +83,17 @@ package Model.Nav { ...@@ -88,19 +83,17 @@ package Model.Nav {
} }
} }
package Model.Map {
WorldEntity <|-- MapObject
abstract class MapObject { abstract class MapObject {
+ Enter(Person) : Vector2? {abstract} + Enter(Person) : Vector2? {abstract}
+ Exit(Person) {abstract} + Exit(Person) {abstract}
} }
MapObject --|> WorldEntity
class Cell { class Cell {
} }
Cell "1" *-- MapObject Cell *- "1" MapObject
Cell "{0,1}" *-- VertexHandle Cell *-- "{0,1}" VertexHandle
enum Orientation { enum Orientation {
NORTH NORTH
...@@ -113,17 +106,16 @@ package Model.Map { ...@@ -113,17 +106,16 @@ package Model.Map {
+ Pos : Vector2 + Pos : Vector2
} }
Placement *- "1" Orientation
Placement "1" *-- Orientation
Simulation "1" *- Map
class Map { class Map {
+ Map(Vector2) + Map(Vector2)
+ CanBuild(IMapObjectBlueprint) : bool + CanBuild(IMapObjectBlueprint) : bool
+ Build(IMapObjectBlueprint) + Build(IMapObjectBlueprint)
} }
Map "*" *-- Cell Map *- "*" Cell
Map "1" *-- NavigationGraph Map *-- "1" NavigationGraph
Simulation *-- "1" Map
class NavigableCell { class NavigableCell {
+ Pos : Vector2 + Pos : Vector2
...@@ -136,7 +128,6 @@ package Model.Map { ...@@ -136,7 +128,6 @@ package Model.Map {
+ CanPlace(Map, Placement) : bool + CanPlace(Map, Placement) : bool
+ Place(Map, Placement) : MapObject + Place(Map, Placement) : MapObject
} }
} }
...@@ -160,9 +151,6 @@ package Model.People { ...@@ -160,9 +151,6 @@ package Model.People {
+ SetDestination(MapObject) + SetDestination(MapObject)
} }
Person <|-- Visitor
class Visitor { class Visitor {
- mood : int - mood : int
- satiety : int - satiety : int
...@@ -179,9 +167,7 @@ package Model.People { ...@@ -179,9 +167,7 @@ package Model.People {
+ ModifyMoney(int) + ModifyMoney(int)
+ SetInQueue(bool) + SetInQueue(bool)
} }
Visitor --|> Person
Person <|-- Staff
class Staff { class Staff {
- idle : bool - idle : bool
...@@ -191,25 +177,22 @@ package Model.People { ...@@ -191,25 +177,22 @@ package Model.People {
+ IsIdle() : bool + IsIdle() : bool
+ SetDestination(MapObject) {override} + SetDestination(MapObject) {override}
} }
Staff --|> Person
Staff <|-- CleaningLady
class CleaningLady { class CleaningLady {
+ CleaningLady(Vector2, float) + CleaningLady(Vector2, float)
+ Tick() {override} + Tick() {override}
+ GetProperties() {override} + GetProperties() {override}
} }
CleaningLady --|> Staff
Staff <|-- MaintenanceGuy
MaintenanceDispatcher *-- "-maintainers\n*" MaintenanceGuy
class MaintenanceGuy { class MaintenanceGuy {
+ MaintenanceGuy(Vector2, float) + MaintenanceGuy(Vector2, float)
+ Tick() {override} + Tick() {override}
+ GetProperties() {override} + GetProperties() {override}
} }
MaintenanceGuy --|> Staff
MaintenanceDispatcher *-- "-maintainers\n*" MaintenanceGuy
} }
...@@ -267,7 +250,7 @@ package Model.Landscape { ...@@ -267,7 +250,7 @@ package Model.Landscape {
} }
Building --|> MapObject Building --|> MapObject
Building --|> ITickable Building --|> ITickable
Building "1" *-- BuildingState Building *-- "1" BuildingState
class StaffBuilding { class StaffBuilding {
... ...
......