|
|
|
 |
|
|
|
```plantuml
|
|
|
|
@startuml
|
|
|
|
package UnityEngine <<Frame>> {
|
|
|
|
class ScriptableObject
|
|
|
|
class MonoBehavior
|
|
|
|
class NetworkBehavior
|
|
|
|
}
|
|
|
|
|
|
|
|
package Model <<Frame>> {
|
|
|
|
class ActionValidator {
|
|
|
|
-networkManager: NetworkManager
|
|
|
|
-playerInputsAndActions : Dictionary<vector3,ActionTypes>
|
|
|
|
ActionValidator()
|
|
|
|
+Validate()
|
|
|
|
}
|
|
|
|
|
|
|
|
class VisibleTiles{
|
|
|
|
VisibleTiles()
|
|
|
|
-GetVisibleTiles(Vector3)
|
|
|
|
}
|
|
|
|
|
|
|
|
enum ActionTypes{
|
|
|
|
ConnectCubes
|
|
|
|
ConectToCube
|
|
|
|
DisconectCubes
|
|
|
|
DisconectFromCube
|
|
|
|
Wait
|
|
|
|
Turn
|
|
|
|
Move
|
|
|
|
Clean
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Visibility{
|
|
|
|
Seeing
|
|
|
|
Seen
|
|
|
|
Hidden
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
package View <<Frame>>
|
|
|
|
{
|
|
|
|
package NetworkBehaviorClasses <<Frame>>{
|
|
|
|
class GameManager {
|
|
|
|
-teams : Teams
|
|
|
|
-turnNumber : NetworkVariable<int>
|
|
|
|
-turnTimer : float
|
|
|
|
-teamScores : NetworkVariable<int>
|
|
|
|
-hud : HUD
|
|
|
|
-movementMapManager : MovementMapManager
|
|
|
|
-visibilityMapManager : VisibilityMapManager
|
|
|
|
-cubeSpawn : CubeSpawner
|
|
|
|
+Start()
|
|
|
|
-UpdateHUD()
|
|
|
|
-UpdateOccupiedSpaces()
|
|
|
|
-UpdateVisibility()
|
|
|
|
-TurnEnd()
|
|
|
|
-GameEnd()
|
|
|
|
}
|
|
|
|
|
|
|
|
class CubeSpawner {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
class VisibilityMapManager{
|
|
|
|
-VisibilitySpaces : Dictinoary<Vector3Int, Visibility>
|
|
|
|
-validator : VisibleTiles
|
|
|
|
-UpdateMap()
|
|
|
|
}
|
|
|
|
|
|
|
|
class MovementMapManager {
|
|
|
|
-tileMap : TileMap
|
|
|
|
-dataFromBorderTiles : Dictionary<TileBase, TileData>
|
|
|
|
-OcupiedSpaces : Dictinoary<Vector3Int, bool>
|
|
|
|
+IsSpaceInvalid(Vector3Int location)
|
|
|
|
}
|
|
|
|
|
|
|
|
class Player {
|
|
|
|
-actionUI : RobotActionUI
|
|
|
|
-networkManager: NetworkManager
|
|
|
|
+inputPos : Vector3
|
|
|
|
+iD : int
|
|
|
|
+actionType : ActionTypes
|
|
|
|
-Start()
|
|
|
|
-Update()
|
|
|
|
-SendData(int,Vector3,ActionTypes)
|
|
|
|
}
|
|
|
|
|
|
|
|
class Teams {
|
|
|
|
+name : String
|
|
|
|
+PlayerIDs : int
|
|
|
|
-Start()
|
|
|
|
}
|
|
|
|
|
|
|
|
struct NetworkingData{
|
|
|
|
iD : int
|
|
|
|
inputPos : Vector3
|
|
|
|
actionType : ActionTypes
|
|
|
|
}
|
|
|
|
|
|
|
|
class Cube{
|
|
|
|
isConected : bool
|
|
|
|
}
|
|
|
|
|
|
|
|
class NetworkManager {
|
|
|
|
-validator : ActionValidator
|
|
|
|
-playerIDmapToGameobject : Dictionary<Gameobject,int>
|
|
|
|
-doActions : Action
|
|
|
|
-Start()
|
|
|
|
-Validate()
|
|
|
|
-ExecuteActions()
|
|
|
|
-UpdateActionsServerRpc(NetworkingData)
|
|
|
|
}
|
|
|
|
|
|
|
|
class MessageManager {
|
|
|
|
-ui : MessageUI
|
|
|
|
-Data : MessageData[]
|
|
|
|
-SendTextClientRPC(FixedString)
|
|
|
|
}
|
|
|
|
|
|
|
|
class TaskManager {
|
|
|
|
-Data : TaskData[]
|
|
|
|
-ui : TaskUI
|
|
|
|
-ShowTask()
|
|
|
|
-ValidTask()
|
|
|
|
}
|
|
|
|
|
|
|
|
abstract Action {
|
|
|
|
+doAction()
|
|
|
|
}
|
|
|
|
|
|
|
|
class MoveAction {
|
|
|
|
+doAction()
|
|
|
|
-Move()
|
|
|
|
-MoveChilds()
|
|
|
|
}
|
|
|
|
|
|
|
|
class CleanAction {
|
|
|
|
+doAction()
|
|
|
|
}
|
|
|
|
|
|
|
|
class TurnAction {
|
|
|
|
+doAction()
|
|
|
|
}
|
|
|
|
|
|
|
|
class ConnectCubesAction {
|
|
|
|
+doAction()
|
|
|
|
}
|
|
|
|
|
|
|
|
class ConnectToCubeAction {
|
|
|
|
+doAction()
|
|
|
|
}
|
|
|
|
|
|
|
|
class DisconnectCubesAction {
|
|
|
|
+doAction()
|
|
|
|
}
|
|
|
|
|
|
|
|
class DisconnectFromCubeAction {
|
|
|
|
-taskManager : TaskManager
|
|
|
|
+doAction()
|
|
|
|
-ValidateTask()
|
|
|
|
}
|
|
|
|
class WaitAction {
|
|
|
|
+doAction()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
package ScriptableObjectClasses <<Frame>> {
|
|
|
|
class BorderData {
|
|
|
|
+tiles : TileBase[]
|
|
|
|
+isWall: bool
|
|
|
|
+isExit: bool
|
|
|
|
}
|
|
|
|
class TaskData {
|
|
|
|
|
|
|
|
}
|
|
|
|
class MessageData {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
package MonoBehaviorClasses <<Frame>>{
|
|
|
|
package UI <<Frame>>{
|
|
|
|
class RobotActionUI {
|
|
|
|
-buttonstoaction : Dictionary<Button,ActionType>
|
|
|
|
+actionType : ActionTypes
|
|
|
|
-Update()
|
|
|
|
+OnClickGetActionType(ActionTypes)
|
|
|
|
-UpdateVisual()
|
|
|
|
}
|
|
|
|
|
|
|
|
class MainMenuUI {
|
|
|
|
newGame : Button
|
|
|
|
exit : Button
|
|
|
|
newGameOnClick()
|
|
|
|
exitOnClick()
|
|
|
|
}
|
|
|
|
|
|
|
|
class HUD {
|
|
|
|
-Update()
|
|
|
|
}
|
|
|
|
class TimerUI {
|
|
|
|
+timerOn : Bool
|
|
|
|
+timerText : Text
|
|
|
|
|
|
|
|
-Start()
|
|
|
|
-Update()
|
|
|
|
-UpdateText()
|
|
|
|
}
|
|
|
|
|
|
|
|
class MessageUI {
|
|
|
|
-Start()
|
|
|
|
-UpdateMessage()
|
|
|
|
}
|
|
|
|
|
|
|
|
class TaskUI {
|
|
|
|
-Start()
|
|
|
|
-UpdateTask()
|
|
|
|
}
|
|
|
|
|
|
|
|
class JoinHostUI {
|
|
|
|
-Start()
|
|
|
|
-Join()
|
|
|
|
-Host()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hide ScriptableObject members
|
|
|
|
hide MonoBehavior members
|
|
|
|
hide NetworkBehavior members
|
|
|
|
|
|
|
|
View.MonoBehaviorClasses -up-|> MonoBehavior
|
|
|
|
View.ScriptableObjectClasses -up-|> ScriptableObject
|
|
|
|
View.NetworkBehaviorClasses -up-|> NetworkBehavior
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skinparam groupInheritance 8
|
|
|
|
|
|
|
|
Action <|-Down[#Blue]- MoveAction
|
|
|
|
Action <|-Down[#Blue]- CleanAction
|
|
|
|
Action <|-Down[#Blue]- TurnAction
|
|
|
|
Action <|-Down[#Blue]- ConnectCubesAction
|
|
|
|
Action <|-Down[#Blue]- ConnectToCubeAction
|
|
|
|
Action <|-Down[#Blue]- DisconnectCubesAction
|
|
|
|
Action <|-Down[#Blue]- DisconnectFromCubeAction
|
|
|
|
Action <|-Down[#Blue]- WaitAction
|
|
|
|
|
|
|
|
TaskManager --* DisconnectFromCubeAction
|
|
|
|
TaskManager *-Right- TaskData
|
|
|
|
TaskManager *-[#red]- TaskUI
|
|
|
|
|
|
|
|
GameManager *-Down- Teams
|
|
|
|
GameManager *-Down- VisibilityMapManager
|
|
|
|
GameManager *-Down- MovementMapManager
|
|
|
|
GameManager *-[#red]- HUD
|
|
|
|
|
|
|
|
Player *-Right- NetworkManager
|
|
|
|
Player *-[#red]- RobotActionUI
|
|
|
|
|
|
|
|
Player o-Right- NetworkingData
|
|
|
|
NetworkManager o-- NetworkingData
|
|
|
|
|
|
|
|
CubeSpawner --* GameManager
|
|
|
|
CubeSpawner *-- Cube
|
|
|
|
|
|
|
|
NetworkManager *-- ActionValidator
|
|
|
|
VisibilityMapManager *-- VisibleTiles
|
|
|
|
MessageManager *-[#red]- MessageUI
|
|
|
|
MessageManager *-Right- MessageData
|
|
|
|
MovementMapManager *-Right- BorderData
|
|
|
|
TimerUI -[#red]-* GameManager
|
|
|
|
@enduml
|
|
|
|
``` |