Update Presentation.UI authored by Horváth István's avatar Horváth István
...@@ -369,82 +369,130 @@ package Presentation.World { ...@@ -369,82 +369,130 @@ package Presentation.World {
```plantuml ```plantuml
package Presentation.UI { package Presentation.UI {
class MainMenu { class MainMenu {
Start(): void - Start(): void
OnNewGameClicked(): void - OnNewGameClicked(): void
OnExitClicked(): void - OnExitClicked(): void
} }
class SimulationUI { class SimulationUI {
- _gameState: GameState + TopPanel: string { constant }
- _activePlayer: ActivePlayer + NextButton: string { constant }
Start(): void + BudgetText: string { constant }
OnStateUpdated(): void + BottomPanel: string { constant }
OnDestroy(): void + teamRedColor: Color
+ teamBlueColor: Color
- _activePlayer: Logic.Data.Color
- _battleUI: BattleUI
- _gameManager: GameManager
- _gameOverOverlay: GameOverOverlay
- _pauseOverlay: PauseOverlay
- _selectedTowerType: TowerTypeData
- _simulationManager: SimulationManager
- _towerPlacing: TowerPlacingUI
- _uiState: UIState
- _unitDeployment: UnitDeploymentUI
- GameOverview: GameOverview
- Start(): void
- UpdateUiState(UIState): void
- OnDestroy(): void
- OnResumeClicked(): void
- OnNewGameClicked(): void
- OnExitClicked(): void
- HideUIs(): void
- OnPauseClicked(): void
- SetupMousePanning(): void
- OnUnitPurchased(UnitTypeData): void
- StartTowerPlacing(Logic.Data.Color): void
- StepTowerPlacing(): void
- OnTowerTypeSelected(TowerTypeData): void
- OnTileSelected(TilePosition): void
- StepUnitDeployment(Logic.Data.Color): void
- StartBattle(): void
- ShowPauseOverlay(): void
- UpdateUiState(): void
+ event OnGameViewPanStart: Action<MouseDownEvent>
+ event OnGameViewPanEnd: Action<MouseUpEvent>
+ event OnGameViewPanUpdate: Action<MouseMoveEvent>
} }
class TowerPlacingUI { class TowerPlacingUI {
- _activePlayer: ActivePlayer - ui: UIDocument
Start(): void - cardComponent: VisualTreeAsset
Show(): void - towerToPlace: List<TowerTypeData>
Hide(): void - teamBlueColor: UnityEngine.Color
SetActivePlayer(ActivePlayer): void - teamRedColor: UnityEngine.Color
OnUpdate(): void - _activePlayer: Logic.Data.Color
OnTowerButtonClicked(Tower): void
ShowTowerStats(Tower): void - Start(): void
ShowTowerManagement(Tower): void + Show(): void
OnDestroy(): void + Hide(): void
+ SetTeamColors(UnityEngine.Color, UnityEngine.Color): void
event OnTowerUpgraded(Tower) + SetActivePlayer(Logic.Data.Color): void
event OnTowerSelected(Tower) + SetPlayerMoney(int): void
event OnNextClicked() - SetupCards(): void
} + event OnNextClicked: Action
+ event OnTowerTypeSelected: Action<TowerTypeData>
class UnitPurchasingUI { }
- _activePlayer: ActivePlayer
Start(): void class UnitDeploymentUI {
Show(): void - cardComponent: VisualTreeAsset
Hide(): void - ui: UIDocument
SetActivePlayer(ActivePlayer): void - unitTypes: List<UnitTypeData>
OnUpdate(): void - _unitCards: Dictionary<UnitTypeData, VisualElement>
OnUnitButtonClicked(Unit): void - _teamBlueColor: UnityEngine.Color
OnDestroy(): void - _teamRedColor: UnityEngine.Color
- _activePlayer: Logic.Data.Color
event OnUnitPurchased(Unit)
event OnNextClicked() - Start(): void
+ Show(): void
+ Hide(): void
+ SetTeamColors(UnityEngine.Color, UnityEngine.Color): void
+ SetupCards(): void
- UpdateCardUnitCount(VisualElement, int): void
+ SetActivePlayer(Logic.Data.Color): void
+ SetPlayerMoney(int): void
+ event OnUnitPurchased: Action<UnitTypeData>
+ event OnNextClicked: Action
} }
class BattleUI { class BattleUI {
Start(): void - ui: UIDocument
Show(): void
Hide(): void
OnUpdate(): void
OnDestroy(): void
event OnExitClicked() - Start(): void
event OnPauseClicked() + Show(): void
+ Hide(): void
+ event OnPauseClicked: Action
} }
class GameOverOverlay { class GameOverOverlay {
Start(): void
Show(): void
Hide(): void
OnDestroy(): void
event OnOkClicked()
} }
class PauseOverlay { class PauseOverlay {
Start(): void - ui: UIDocument
Show(): void
Hide(): void - Start(): void
OnDestroy(): void + Show(): void
+ Hide(): void
+ event OnExitClicked()
+ event OnNewGameClicked()
+ event OnResumeClicked()
}
event OnExitClicked() enum UIState {
event OnNewGameClicked() TowerPlacing
event OnResumeClicked() UnitDeployment
Battle
Paused
GameOver
} }
SimulationUI *-- UnitPurchasingUI SimulationUI *-- UIState
SimulationUI *-- UnitDeploymentUI
SimulationUI *-- TowerPlacingUI SimulationUI *-- TowerPlacingUI
SimulationUI *-- BattleUI SimulationUI *-- BattleUI
SimulationUI *-- GameOverOverlay SimulationUI *-- GameOverOverlay
... ...
......