Home - JackFawthorpe/mas-competition-engine GitHub Wiki
Flow of Game
The following are sequence diagrams to outline the involvement of each component within the game
Action Phase of Turn
sequenceDiagram
participant TM as TurnManager
participant RFA as RequestForActionRouter
participant PC as PlayerController
participant P as Player
participant CI as ControllerImplementation
participant C as Card
TM->>RFA: Queue PlayActionRequest
RFA->>PC: PlayActionRequest
PC->>P: Get Action Cards
P ->>PC: Action Cards
PC->>CI: Pick Action Card
CI->>PC: Picks Action or Card or null
alt Skips Play
PC->>TM: Response Sent (null)
else Plays card
PC->>C: Play Card
C->>PC: Card Played
PC->>RFA: Response Sent (Card Played)
RFA->>TM: Response Sent (Card Played)
end
Buy Action Flow
sequenceDiagram
participant KM as KingdomManager
participant TM as TurnManager
participant RFA as RequestForActionRouter
participant PC as PlayerController
participant CI as ControllerImplementation
TM ->> KM: Get available purchases (cost)
KM ->> TM: List of available purchases
TM ->> RFA: Request for player to buy a card
RFA ->> PC: Forward Request
PC ->> CI: Choose Card
CI ->> PC: Card Chosen
alt Skips buy
PC ->> RFA: Response
RFA ->> TM: Response
else Buys Card
PC ->> RFA: Return Card Chosen
RFA ->> TM: Return Response
TM ->> KM: Remove Card From Kingdom
end
Attack Card flow
sequenceDiagram
participant C as Card
participant RFA as RequestForActionRouter
participant GEB as GameEventBus
participant R as ReactionCard
participant PC as PlayerController
C ->> RFA : Request with Attack Tag
RFA ->> GEB: Fire attack event
GEB ->> R: Fire Attack Event
R ->> GEB: Proxied Attack Request with cancel clause
GEB ->> RFA: Proxied Attack Request
alt Attack Blocked
RFA ->> C: Blocked Response
else Proceeds
RFA ->> PC: Modified RFA
PC ->> RFA: Resolution as usual
RFA ->> C: Resolution as usual
end