Initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
@startuml
|
||||
class CommandDTO {
|
||||
- commandName : string
|
||||
- parameters : Dictionary<string, object>
|
||||
+ CommandName : string <<get>>
|
||||
+ Parameters : Dictionary<string, object> <<get>>
|
||||
+ converToCommand() : ICommand
|
||||
}
|
||||
class CommandDTOBuilder {
|
||||
- commandName : string
|
||||
- parameters : Dictionary<string, object>
|
||||
+ SetCommandName(name:string) : CommandDTOBuilder
|
||||
+ AddParameter(key:string, value:object) : CommandDTOBuilder
|
||||
+ Build() : CommandDTO
|
||||
}
|
||||
CommandDTO +-- CommandDTOBuilder
|
||||
@enduml
|
||||
@@ -0,0 +1,20 @@
|
||||
@startuml
|
||||
class CommandHandler {
|
||||
- {static} instance : CommandHandler
|
||||
- commandManager : CommandManager
|
||||
- environment : Environment
|
||||
+ {static} getInstance() : CommandHandler
|
||||
- Awake() : void
|
||||
- Start() : void
|
||||
- Update() : void
|
||||
+ createBlock(prefabId:string, position:Vector3, rotation:Quaternion) : void
|
||||
+ moveBlock(blockId:string, prePosition:Vector3, newPosition:Vector3, preRotation:Quaternion, newRotation:Quaternion) : void
|
||||
+ removeBlock(blockId:string) : void
|
||||
+ removeGroup(blockIds:List<string>) : void
|
||||
+ rotateBlock(blockId:string, newRotation:Quaternion) : void
|
||||
+ undoAction() : void
|
||||
+ redoAction() : void
|
||||
+ clearHistory() : void
|
||||
}
|
||||
MonoBehaviour <|-- CommandHandler
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class CommandManager {
|
||||
- {static} instance : CommandManager
|
||||
- commandStack : LinkedList<ICommand>
|
||||
- redoStack : LinkedList<ICommand>
|
||||
- maxCapacity : int = 100
|
||||
- CommandManager()
|
||||
+ {static} getInstance() : CommandManager
|
||||
+ setMaxCapacity(capacity:int) : void
|
||||
+ executeCommand(command:ICommand) : void
|
||||
+ undo() : void
|
||||
+ redo() : ICommand
|
||||
+ clearHistory() : void
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,18 @@
|
||||
@startuml
|
||||
class CreateBlockCommand {
|
||||
- prefabId : string
|
||||
- position : Vector3
|
||||
- rotation : Quaternion
|
||||
- objectCreated : GameObject
|
||||
- blockId : string
|
||||
- layerDiff : bool
|
||||
- factory : BlockFactory
|
||||
- environment : Environment
|
||||
+ CreateBlockCommand(prefabId:string, position:Vector3, rotation:Quaternion, LayerDiff:bool)
|
||||
+ CreateBlockCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- CreateBlockCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,16 @@
|
||||
@startuml
|
||||
class DeleteBlockCommand {
|
||||
- blockId : string
|
||||
- prefabDeletedId : string
|
||||
- blockInitialPosition : Vector3
|
||||
- blockInitialRotation : Quaternion
|
||||
- factory : BlockFactory
|
||||
- environment : Environment
|
||||
+ DeleteBlockCommand(blockId:string)
|
||||
+ DeleteBlockCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- DeleteBlockCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,12 @@
|
||||
@startuml
|
||||
class DeleteGroupCommand {
|
||||
- blocksId : List<string>
|
||||
- deleteBlockCommands : List<DeleteBlockCommand>
|
||||
+ DeleteGroupCommand(blocksId:List<string>)
|
||||
+ DeleteGroupCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- DeleteGroupCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
interface ICommand {
|
||||
execute() : void
|
||||
undo() : void
|
||||
toDTO() : CommandDTO
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,17 @@
|
||||
@startuml
|
||||
class MoveBlockCommand {
|
||||
- blockId : string
|
||||
- previousPosition : Vector3
|
||||
- previousRotation : Quaternion
|
||||
- newPosition : Vector3
|
||||
- newRotation : Quaternion
|
||||
- environment : Environment
|
||||
- blockTransform : Transform
|
||||
+ MoveBlockCommand(blockId:string, previousPosition:Vector3, newPosition:Vector3, previousRotation:Quaternion, newRotation:Quaternion)
|
||||
+ MoveBlockCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- MoveBlockCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class RotateblockCommand {
|
||||
- blockId : string
|
||||
- newRotation : Quaternion
|
||||
- previousRotation : Quaternion
|
||||
- environment : Environment
|
||||
- blockTransform : Transform
|
||||
+ RotateblockCommand(blockId:string, newRotation:Quaternion)
|
||||
+ RotateblockCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- RotateblockCommand
|
||||
@enduml
|
||||
Reference in New Issue
Block a user