Skip to content

Instantly share code, notes, and snippets.

@marty-suzuki
Created May 12, 2020 17:40
Show Gist options
  • Save marty-suzuki/bab791caa5d7de410728ec07bba2c288 to your computer and use it in GitHub Desktop.
Save marty-suzuki/bab791caa5d7de410728ec07bba2c288 to your computer and use it in GitHub Desktop.
@startuml
package Reversi.app {
class ViewController {
~ viewModel: ReversiViewModelType
}
}
package ReversiLogic.framework {
class ReversiViewModel {
+ input: InputWrapper<ReversiViewModel.Input>
+ output: InputWrapper<ReversiViewModel.Output>
- managementStream: ReversiManagementStreamType
+ static func bind() -> ReversiViewModel.Output
}
class ReversiManagementStream {
+ input: InputWrapper<ReversiManagementStream.Input>
+ output: InputWrapper<ReversiManagementStream.Output>
- actionCreator: GameActionCreatorProtocol
- store: GameStoreProtocol
- alertManagement: AlertManagementProtocol
- nextTurnManagement: NextTurnManagementProtocol
- playerTurnManagement: PlayerTurnManagementProtocol
- placeDisk: PlaceDiskProtocol
- setDisk: SetDiskProtocol
- validMoves: ValidMovesProtocol
+ static func bind() -> ReversiManagementStream.Output
}
class GameActionCreator {
- dispatcher: GameDispatcher
- cache: GameDataCacheProtocol
}
class GameDispatcher {
}
class GameStore {
- dispatcher: GameDispatcher
}
class GameDataCache {
- saveGame: GameDataIO.SaveGame
- loadGame: GameDataIO.LoadGame
}
class GameDataIO <<E, pink>> {
~ static func save() as SaveGame
~ static func loadGame() as LoadGame
}
class ValidMoves <<S, orange>> {
~ flippedDiskCoordinates: FlippedDiskCoordinatesProtocol
~ store: GameStoreProtocol
~ func callAsFunction() -> Single<~[Coordinate]>
}
class FlippedDiskCoordinates <<S, orange>> {
~ store: GameStoreProtocol
~ func callAsFunction() -> Single<[Coordinate]>
}
class SetDisk <<S, orange>> {
~ actionCreator: GameActionCreatorProtocol
~ func callAsFunction() -> Single<Bool>
}
class PlaceDisk <<S, orange>> {
~ flippedDiskCoordinates: FlippedDiskCoordinatesProtocol
~ setDisk: SetDiskProtocol
~ animateSettingDisks: AnimateSettingDisksProtocol
~ actionCreator: GameActionCreatorProtocol
~ store: GameStoreProtocol
~ func callAsFunction() -> Single<Bool>
}
class AnimateSettingDisks <<S, orange>> {
~ setDisk: SetDiskProtocol
~ store: GameStoreProtocol
~ func callAsFunction() -> Single<Bool>
}
class NextTurnManagement <<S, orange>> {
~ store: GameStoreProtocol
~ actionCreator: GameActionCreatorProtocol
~ validMoves: ValidMovesProtocol
~ func callAsFunction() -> Observable<NextTurn.Response>
}
class PlayerTurnManagement <<S, orange>> {
~ store: GameStoreProtocol
~ actionCreator: GameActionCreatorProtocol
~ validMoves: ValidMovesProtocol
~ func callAsFunction() -> Observable<(Disk, Coordinate)>
}
class AlertManagement <<S, orange>> {
~ store: GameStoreProtocol
~ actionCreator: GameActionCreatorProtocol
~ func callAsFunction() -> Observable<Alert>
}
}
ViewController -down-> "1" ReversiViewModel : "viewModel"
ReversiViewModel -down-> "1" ReversiManagementStream : "managementStream"
ReversiManagementStream --> "1" GameActionCreator: "actionCreator"
ReversiManagementStream --> "1" GameStore: "store"
ReversiManagementStream --> "1" ValidMoves: "validMoves"
ReversiManagementStream --> "1" SetDisk: "setDisk"
ReversiManagementStream --> "1" PlaceDisk: "placeDisk"
ReversiManagementStream --> "1" NextTurnManagement: "nextTurnManagement"
ReversiManagementStream --> "1" PlayerTurnManagement: "playerTurnManagement"
ReversiManagementStream --> "1" AlertManagement: "alertManagement"
AlertManagement --> "1" GameStore: "store"
AlertManagement --> "1" GameActionCreator: "actionCreator"
NextTurnManagement --> "1" GameStore: "store"
NextTurnManagement --> "1" GameActionCreator: "actionCreator"
NextTurnManagement --> "1" ValidMoves: "validMoves"
PlayerTurnManagement --> "1" GameStore: "store"
PlayerTurnManagement --> "1" GameActionCreator: "actionCreator"
PlayerTurnManagement --> "1" ValidMoves: "validMoves"
PlaceDisk --> "1" FlippedDiskCoordinates: "flippedDiskCoordinates"
PlaceDisk --> "1" SetDisk: "setDisk"
PlaceDisk --> "1" AnimateSettingDisks: "animateSettingDisks"
PlaceDisk --> "1" GameActionCreator: "actionCreator"
PlaceDisk --> "1" GameStore: "store"
AnimateSettingDisks --> "1" SetDisk: "setDisk"
AnimateSettingDisks --> "1" GameStore: "store"
ValidMoves --> "1" GameStore: "store"
ValidMoves --> "1" FlippedDiskCoordinates: "flippedDiskCoordinates"
FlippedDiskCoordinates --> "1" GameStore: "store"
SetDisk --> "1" GameActionCreator: "actionCreator"
GameActionCreator -right-> "1" GameDispatcher: "dispatcher"
GameActionCreator --> "1" GameDataCache: "cache"
GameDataCache -right-> "1" GameDataIO: "saveGame"
GameDataCache -right-> "1" GameDataIO: "loadGame"
GameStore -left-> "1" GameDispatcher: "dispatcher"
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment