Update Class Diagram authored by Karikó Csongor Csanád's avatar Karikó Csongor Csanád
...@@ -538,33 +538,21 @@ UnityEngine.MonoBehaviour <|-- View.BuildingSelector ...@@ -538,33 +538,21 @@ UnityEngine.MonoBehaviour <|-- View.BuildingSelector
View.BuildingPlacer o-- "-builder" Model.IBuilder View.BuildingPlacer o-- "-builder" Model.IBuilder
'Model.IBuilder --> Model.Simulation : <<use>> (TODO: change this to MAP) 'Model.IBuilder --> Model.Simulation : <<use>> (TODO: change this to MAP)
UnityEngine.MonoBehaviour <|-- View.HoverInfoDisplayer
class UnityEngine.EventTrigger
UnityEngine.EventTrigger ..> View.HoverInfoDisplayer : EventTrigger calls into HoverInfoDisplayer
UnityEngine.MonoBehaviour <|-- View.Selectable UnityEngine.MonoBehaviour <|-- View.Selectable
UnityEngine.MonoBehaviour <|-- View.InspectorWindow UnityEngine.MonoBehaviour <|-- View.InspectorWindow
View.InspectorWindow --o View.UIManager View.InspectorWindow --o View.UIManager
View.Selectable o--- "-modelObject" Model.IInspectable View.Selectable o--- "-modelObject" Model.IInspectable
'Model.IInspectable --> Model.Simulation : <<use>> (TODO: chage this to ..) 'Model.IInspectable --> Model.Simulation : <<use>> (TODO: chage this to ..)
UnityEngine.MonoBehaviour <|-- View.CameraController
class View.CameraController {
- mouseSensitivity : float
- mousewheelSensitivity : float
- movementSpeed : float
+ Update() // Called by Unity
}
UnityEngine.ScriptableObject <|-- View.GameConfig UnityEngine.ScriptableObject <|-- View.GameConfig
View.GameConfig o-- Model.SimulationConfig View.GameConfig o-- Model.SimulationConfig
class View.GameConfig { class View.GameConfig {
- config : SimulationConfig - config : SimulationConfig
- entranceData : PavementData
+ GetConfig() : Model.SimulationConfig + Config(getter) : Simulation.Config
+ InsertConfigs()
} }
class View.GameManager { class View.GameManager {
...@@ -603,27 +591,35 @@ enum View.UIManager.UIMode { ...@@ -603,27 +591,35 @@ enum View.UIManager.UIMode {
} }
class View.BuildingPlacer { class View.BuildingPlacer {
- enabled : bool - gridScale : float
- selectedBuilding : BuildingConfig
- buildingGhost : GameObject
- originalMaterial : Material
- buildingMenuItemPrefab : GameObject - buildingMenuItemPrefab : GameObject
- allowedMaterial : Material - entertainmentMenuContent : Transform
- disallowedMaterial : Material - foodMenuContent : Transform
- staffMenuContent : Transform
- pavementMenuContent : Transform
- placementAllowedMaterial : Material
- placementRejectedMaterial : Material
- placementRaycastMask : LayerMask
- builder : IBuilder - builder : IBuilder
- selectedBuilding : BuildingConfig
- buildingGhost : GameObject
- ghostMeshRenderer : MeshRenderer
- ghostRenderers : List<Renderer>
- rotation : int
- Place(Vector3, Quaternion) - SelectBuilding(BuildingConfig)
- BuildBuilding(BuildingConfig, MapPosition, Vector3, Quaternion)
+ Init(BuildingConfig[]) - CheckPrice(ObjectBlueprint)
- DisplayGhostAndPlaceBuilding(Vector3)
- Update()
- OnEnable()
- OnDisable()
+ Enable() - WorldToGridPos(Vector3) : Vector2Int
+ Disable() - GridToWorldPos(Vector2Int) : Vector3
+ Select(BuildingConfig)
+ Update() // called by Unity + GridScale<<getter>> : float
+ Init(BuildingConfig[], IBuilder)
} }
...@@ -633,14 +629,6 @@ class View.BuildingSelector { ...@@ -633,14 +629,6 @@ class View.BuildingSelector {
+ Select() + Select()
} }
class View.HoverInfoDisplayer {
- infoWindow : GameObject
- timeLeft : float
- delay : float
+ OnMouseEnter() // Called by EventTrigger
+ OnMouseExit() // Called by EventTrigger
}
class View.InspectorWindow { class View.InspectorWindow {
- inspectorPanel : RectTransform - inspectorPanel : RectTransform
...@@ -662,12 +650,39 @@ class View.Selectable { ...@@ -662,12 +650,39 @@ class View.Selectable {
UnityEngine.MonoBehaviour <|-- View.DisplayBehaviour UnityEngine.MonoBehaviour <|-- View.DisplayBehaviour
class View.DisplayBehaviour { class View.DisplayBehaviour {
- displayedObject : IDisplayable - displayedObject : IDisplayable
- renderers : List<Renderer>
- colliders : List<Collider>
- epsilon : float
- rotationLerp : float
- positionLerp : float
- teleportThresholdSquared : float
- visible : bool
+ Update() // called by Unity + Renderers<<get>> : List<Renderer>
+ Visible<<get,set>> : bool
+ {virtual} Init(IDisplayable)
- Update() // called by Unity
} }
View.DisplayBehaviour o--- "displayedObject" Model.IDisplayable View.DisplayBehaviour o--- "displayedObject" Model.IDisplayable
View.DisplayBehaviour <|-- View.BuildingBehaviour
class View.BuildingBehaviour {
- constructionDecorations : GameObject
+ Init(IDisplayable) {override}
}
View.DisplayBehaviour <|-- View.PavementBehaviour
class View.PavementBehaviour{
- bin : GameObject
- garbagePrefabs : List<GameObject>
- garbageAreaMin : Vector3
- garbageAreaMax : Vector3
- spawnedGarbage : Queue<GameObject>
- pavement : Pavement
+ Init(IDisplayable) {override}
}
...@@ -675,11 +690,21 @@ UnityEngine.ScriptableObject <|-- View.BuildingConfig ...@@ -675,11 +690,21 @@ UnityEngine.ScriptableObject <|-- View.BuildingConfig
View.BuildingConfig *-- "-data" View.BuildingData View.BuildingConfig *-- "-data" View.BuildingData
'interface Model.IMapObjectBlueprint 'interface Model.IMapObjectBlueprint
class View.BuildingConfig { class View.BuildingConfig {
- data : View.BuildingData + Data : View.BuildingData
+ BuildingPrefab : GameObject + Prefab : GameObject
+ UISprite : Sprite + BuildingSelectorIcon : Sprite
+ MenuCategory : BuildingCategory
+ GridOffset : Vector2Int
+ GetBlueprint() : Model.IMapObjectBlueprint + Blueprint(getter) : Model.IMapObjectBlueprint
}
View.BuildingConfig *-- View.BuildingCategory
enum View.BuildingCategory {
PAVEMENT,
ENTERTAINMENT,
FOOD,
STAFF,
} }
View.BuildingData --|> UnityEngine.ScriptableObject View.BuildingData --|> UnityEngine.ScriptableObject
...@@ -727,5 +752,76 @@ class View.QueuePavementData { ...@@ -727,5 +752,76 @@ class View.QueuePavementData {
+ void GetBlueprint() : Model.IMapObjectBlueprint + void GetBlueprint() : Model.IMapObjectBlueprint
} }
UnityEngine.MonoBehaviour <|-- View.LevelChanger
class View.LevelChanger {
+ ChangeLevel(name)
}
UnityEngine.MonoBehaviour <|-- View.QuitScript
class View.QuitScript{
+ Quit()
}
UnityEngine.MonoBehaviour <|-- View.OffsetAnimation
class View.OffsetAnimation{
- clipName : string
- Start()
}
UnityEngine.MonoBehaviour <|-- View.KeyPressEvent
class View.KeyPressEvent{
- events : List<KeyEvent>
- Update()
}
View.KeyPressEvent *-- View.KeyPressEvent.KeyEvent
class View.KeyPressEvent.KeyEvent {
+ key : KeyCode
+ onPressed : UnityEvent
}
UnityEngine.MonoBehaviour <|-- View.ScrollerHelper
class View.ScrollerHelper{
- scrollbar : Scrollbar
- scrollAmount : float
- contentRect : RectTransform
- target : float
+ LerpT : float
- Awake()
- Update()
+ ScrollRight()
+ ScrollLeft()
}
UnityEngine.MonoBehaviour <|-- View.ToggleGroup
class View.ToggleGroup {
- lastActivated : GameObject
+ Toggle(GameObject)
+ Disable()
}
UnityEngine.MonoBehaviour <|-- View.UIModeChanger
class View.UIModeChanger{
- targetMode: UIMode
+ MatchActiveSelf(GameObject)
+ Change()
}
class View.Extensions(static) {
+ {static} RotateRight(this Vector2Int) : Vector2Int
+ {static} Rotate90(this Vector2Int, int) : Vector2Int
+ {static} ToOrientation(this int) : Orientation
+ {static} ToVector3Scaled(this System.Numerics.Vector2 v) : Vector3
+ {static} ToVec2i(this Vector2Int) : Vec2i
}
class View.MessageBox(static) {
- {static} prefabPath : string
- {static} openCount : int
- {static} offset : Vector3
+ {static} Show(string)
}
@enduml @enduml
``` ```
\ No newline at end of file