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,47 +56,44 @@ package Model.Common { ...@@ -60,47 +56,44 @@ 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 {
class NavigationGraph { package Nav {
+ AddVertex() : VertexHandle class NavigationGraph {
+ AddEdge(VertexHandle, VertexHandle) + AddVertex() : VertexHandle
+ PlanRoute(VertexHandle, VertexHandle) : RouteHandle + AddEdge(VertexHandle, VertexHandle)
} + PlanRoute(VertexHandle, VertexHandle) : RouteHandle
}
class VertexHandle { class VertexHandle {
} }
class RouteHandle { class RouteHandle {
}
} }
}
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 {
...@@ -334,7 +317,7 @@ interface Model.IInspectable { ...@@ -334,7 +317,7 @@ interface Model.IInspectable {
} }
interface Model.IDisplayable { interface Model.IDisplayable {
+ IsAlive() : bool + IsAlive() : bool
+ IsVisible() : bool + IsVisible() : bool
+ GetPosition() : Vector2 + GetPosition() : Vector2
+ GetState() : int + GetState() : int
...@@ -383,9 +366,9 @@ class View.CameraController { ...@@ -383,9 +366,9 @@ class View.CameraController {
UnityEngine.ScriptableObject <|-- View.GameConfig UnityEngine.ScriptableObject <|-- View.GameConfig
View.GameConfig *-- Model.SimulationConfig View.GameConfig *-- Model.SimulationConfig
class View.GameConfig { class View.GameConfig {
- config : SimulationConfig - config : SimulationConfig
+ GetConfig() : Model.SimulationConfig + GetConfig() : Model.SimulationConfig
} }
View.BuildingConfig <.. View.GameManager View.BuildingConfig <.. View.GameManager
...@@ -393,7 +376,7 @@ View.GameManager .> View.UIManager : "<<init>>" ...@@ -393,7 +376,7 @@ View.GameManager .> View.UIManager : "<<init>>"
class View.GameManager { class View.GameManager {
- config : GameConfig - config : GameConfig
- tickInterval : float - tickInterval : float
- isPaused : bool - isPaused : bool
- uiManager : UIManager - uiManager : UIManager
- gridScale : float - gridScale : float
- buildings : BuildingConfig[] - buildings : BuildingConfig[]
...@@ -408,22 +391,22 @@ class View.GameManager { ...@@ -408,22 +391,22 @@ class View.GameManager {
View.Selectable <--> View.UIManager View.Selectable <--> View.UIManager
class View.UIManager { class View.UIManager {
- mode : UIMode - mode : UIMode
- placer : BuildingPlacer - placer : BuildingPlacer
- selection : Selectable - selection : Selectable
+ Init(BuildingConfig[]) + Init(BuildingConfig[])
+ ChangeMode(UIMode) + ChangeMode(UIMode)
+ Select(Selectable) + Select(Selectable)
} }
View.UIManager *- View.UIManager.UIMode View.UIManager *- View.UIManager.UIMode
View.UIManager o- View.BuildingPlacer View.UIManager o- View.BuildingPlacer
enum View.UIManager.UIMode { enum View.UIManager.UIMode {
BUILD BUILD
NORMAL NORMAL
SELECT // for selecting target for cleaning staff SELECT // for selecting target for cleaning staff
} }
class View.BuildingPlacer { class View.BuildingPlacer {
...@@ -484,9 +467,9 @@ class View.Selectable { ...@@ -484,9 +467,9 @@ class View.Selectable {
UnityEngine.MonoBehaviour <|-- View.DisplayBehaviour UnityEngine.MonoBehaviour <|-- View.DisplayBehaviour
class View.DisplayBehaviour { class View.DisplayBehaviour {
- displayedObject : IDisplayable - displayedObject : IDisplayable
+ Update() // called by Unity + Update() // called by Unity
} }
View.DisplayBehaviour o--- Model.IDisplayable View.DisplayBehaviour o--- Model.IDisplayable
...@@ -500,7 +483,7 @@ class View.BuildingConfig { ...@@ -500,7 +483,7 @@ class View.BuildingConfig {
- blueprint : Model.ObjectBlueprint - blueprint : Model.ObjectBlueprint
+ BuildingPrefab : GameObject + BuildingPrefab : GameObject
+ UISprite : Sprite + UISprite : Sprite
+ GetBlueprint() : Model.ObjectBlueprint + GetBlueprint() : Model.ObjectBlueprint
} }
... ...
......