diff --git a/README.md b/README.md index 3fb68d4..c837438 100644 --- a/README.md +++ b/README.md @@ -75,4 +75,5 @@ Infra Architecture ============ -[Diagram](./doc/Workflow.puml) \ No newline at end of file +- [Workflow Diagram](./doc/Workflow.puml) +- [Entities and Projections Diagram](./doc/Entities.puml) \ No newline at end of file diff --git a/doc/Entities.puml b/doc/Entities.puml new file mode 100644 index 0000000..c72c7a7 --- /dev/null +++ b/doc/Entities.puml @@ -0,0 +1,93 @@ +@startuml +'https://plantuml.com/class-diagram + +left to right direction + +class GameList <> { + + status: Status +} +class GameState <> { + + players: List + + currentPlayerTurn: Player + + lastCardPlayer: Player + + colorOnCurrentStack: Color + + direction: Direction + + readyPlayers: List + + deck: Deck + + isStarted: Boolean + + playerWins: List +} +interface Card { + + id: UUID +} +enum Color { + + Blue + + Red + + Yellow + + Green +} +class GameId { + + id: UUID +} +class Player { + + id: PlayerId + + name: String +} +class Deck { + + stack: Stack + + discard: Discard + + playersHands: PlayersHands +} +class Stack { + + cards: List + + shuffle() +} +class Discard { + + cards: List +} +class PlayerHands { + + map: Map> +} + +class NumericCard { + + number: Int + + color: Color +} +class ReverseCard { + + color: Color +} +class PassCard { + + color: Color +} +class Plus2Card { + + color: Color +} +class Plus4Card +class ChangeColorCard + +GameState *-- Deck +GameState o-- "many" Player +Deck *-- PlayerHands +PlayerHands *-- "many" Card +PlayerHands o-- "many" Player +Stack *-- "many" Card +Discard *-- "many" Card +Deck *-- Stack +Deck *-- Discard +GameState *-- GameId +Card <|--- NumericCard +Card <|--- ReverseCard +Card <|--- PassCard +Card <|--- ChangeColorCard +Card <|--- Plus2Card +Card <|--- Plus4Card + +ReverseCard o-- Color +NumericCard o-- Color +PassCard o-- Color +Plus2Card o-- Color + +GameList *-- GameId +GameList o-- "many" Player + +@enduml \ No newline at end of file