Update Class Diagram authored by Karikó Csongor Csanád's avatar Karikó Csongor Csanád
......@@ -538,33 +538,21 @@ UnityEngine.MonoBehaviour <|-- View.BuildingSelector
View.BuildingPlacer o-- "-builder" Model.IBuilder
'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.InspectorWindow
View.InspectorWindow --o View.UIManager
View.Selectable o--- "-modelObject" Model.IInspectable
'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
View.GameConfig o-- Model.SimulationConfig
class View.GameConfig {
- config : SimulationConfig
- entranceData : PavementData
+ GetConfig() : Model.SimulationConfig
+ Config(getter) : Simulation.Config
+ InsertConfigs()
}
class View.GameManager {
......@@ -603,27 +591,35 @@ enum View.UIManager.UIMode {
}
class View.BuildingPlacer {
- enabled : bool
- selectedBuilding : BuildingConfig
- buildingGhost : GameObject
- originalMaterial : Material
- gridScale : float
- buildingMenuItemPrefab : GameObject
- allowedMaterial : Material
- disallowedMaterial : Material
- entertainmentMenuContent : Transform
- foodMenuContent : Transform
- staffMenuContent : Transform
- pavementMenuContent : Transform
- placementAllowedMaterial : Material
- placementRejectedMaterial : Material
- placementRaycastMask : LayerMask
- builder : IBuilder
- selectedBuilding : BuildingConfig
- buildingGhost : GameObject
- ghostMeshRenderer : MeshRenderer
- ghostRenderers : List<Renderer>
- rotation : int
- Place(Vector3, Quaternion)
+ Init(BuildingConfig[])
- SelectBuilding(BuildingConfig)
- BuildBuilding(BuildingConfig, MapPosition, Vector3, Quaternion)
- CheckPrice(ObjectBlueprint)
- DisplayGhostAndPlaceBuilding(Vector3)
- Update()
- OnEnable()
- OnDisable()
+ Enable()
+ Disable()
+ Select(BuildingConfig)
- WorldToGridPos(Vector3) : Vector2Int
- GridToWorldPos(Vector2Int) : Vector3
+ Update() // called by Unity
+ GridScale<<getter>> : float
+ Init(BuildingConfig[], IBuilder)
}
......@@ -633,14 +629,6 @@ class View.BuildingSelector {
+ Select()
}
class View.HoverInfoDisplayer {
- infoWindow : GameObject
- timeLeft : float
- delay : float
+ OnMouseEnter() // Called by EventTrigger
+ OnMouseExit() // Called by EventTrigger
}
class View.InspectorWindow {
- inspectorPanel : RectTransform
......@@ -662,12 +650,39 @@ class View.Selectable {
UnityEngine.MonoBehaviour <|-- View.DisplayBehaviour
class View.DisplayBehaviour {
- 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 <|-- 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
View.BuildingConfig *-- "-data" View.BuildingData
'interface Model.IMapObjectBlueprint
class View.BuildingConfig {
- data : View.BuildingData
+ BuildingPrefab : GameObject
+ UISprite : Sprite
+ Data : View.BuildingData
+ Prefab : GameObject
+ 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
......@@ -727,5 +752,76 @@ class View.QueuePavementData {
+ 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
```
\ No newline at end of file