0% found this document useful (0 votes)
2 views3 pages

Game Sequence Flowchart

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Game Sequence Flowchart

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

@startuml

!theme plain

actor Player #red


participant Game
participant Board
participant Dice
participant Space
participant Property
participant Trivia
participant Airport
participant Jail

Game-->Player: Start Game Message after Organiser Setup(GameStart)


activate Game

Game->Board: initialiseBoard(GameStart)
activate Board
Board-->Game: initialiseBoard(GameStart)
Game-->Player: initialiseBoardMessage(GameStart)
activate Player

loop while (game not over)


Game-->Player: requestNextPlayer(player)
Player->Game: NextPlayer(player)
activate Property
Game->Property: getPropertyOwned(propertyOwnedByPlayer)
Property-->Game: displayPropertyOwned(propertyOwnedByPlayer)
Game-->Player: chooseToDevelopProperty(price)
Player->Game: responseToDevelopProperty(price)
Game->Property: devPropertyOwned(propertyOwnedByPlayer)
Property-->Game: applyDevPropertyOwned(propertyOwnedByPlayer)
deactivate Property

Player->Game: rollDice()
activate Dice
Game->Dice:rolldice(diceValue)
Dice-->Game:returnRolldice(diceValue)
Game-->Player: displayRolldice(diceValue)
deactivate Dice

activate Space
Game->Space: getCurrentSpace(playerToken)
Space-->Game: returnCurrentSpace(playerToken)
Game->Space: movePlayerToken(spaces)
Game-->Player: movePlayerTokenMessage(spaces)
Game->Space: getPropertyLocation(currentSpace)
Game->Space: checkLandingSpace(player)
Space->Game: if (Landing Space is Property)
activate Property
alt unowned
Game->Board: checkIfUnowned()
Board->Property: checkIfUnowned(price)
Property-->Board: getPrice(price)
Board-->Player: getPrice(price)
Player->Game: chooseToBuyProperty(price)
Game-->Player: updateBalance(-price)
Game->Property: setOwner(player)
Property-->Game: confirmSetOwner(player)
else owned
Game->Property: getOwner()
Property-->Game: getOwner(opponentPlayer, fee)
Game-->Player: payRent(player, opponentPlayer, fee)
Player->Game: payRent(fee
Game-->Player: transferRent(opponentPlayer,fee)
deactivate Property

else if (Landing Space is Trivia)


activate Trivia
Game->Trivia: drawTrivia()
Trivia-->Game: requestTriviaAnswer(player, question)
Game-->Player: requestTriviaAnswer(player, question)
Player->Game: giveTriviaAnswer(player, answer)
Game->Trivia: giveTriviaAnswer(player, answer)
Trivia-->Game: applyTriviaEffects(player)
Game-->Player: applyTriviaEffects(player, currentSpace)
deactivate Trivia

else if (Landing Space is Airport)


activate Airport
Game->Space: getFee()
Space->Airport: getFee(feeAmount)
Airport-->Space: : returnFee(feeAmount)

Game->Airport: getAirportMovement()
Airport-->Game: applyAirportMovement(player, currentSpace)

Space-->Game: returnFee(feeAmount)
Game-->Player: returnFee(feeAmount)
Player->Game: payFee(feeAmount)
Game-->Player: updateBalance(-feeAmount)
deactivate Airport

else if (Landing Space is Jail)


activate Jail
Game-->Player: goToJailMessage()
Player->Game: goToJail()
Game->Jail: goToJail()
Player->Game: checkIsInJail(jailTurnsNum)
Game->Jail: checkIsInJail(jailTurnsNum)
Jail-->Game: responseIsInJail(jailTurnsNum)
Game-->Player: responseIsInJail(jailTurnsNum)
loop while (In Jail and not rolled doubles)
activate Dice
Game-->Player: rollDiceMessage()
Player->Game: attemptRollDoubles()
Game->Dice: attemptRollDoubles(diceValue)
Dice-->Game: resultsIfRollDoubles(diceValue)
Game-->Player: resultsIfRollDoubles(diceValue)
deactivate Dice
end
Player->Game: releaseFromJail()
deactivate Jail

else if (Landing Space is Go)


Player->Game: collectGoMoney(amount)
Game-->Player: updatePlayerBalance(player, +amount)

else if (Landing Space is JailJustVisiting)


Player->Game: JailJustVisiting(player, currentSpace)
Game-->Player: messageJailJustVisiting()

Game->Player: endTurn()
deactivate Space

end

Player->Game: checkWinCondition()
Game-->Player: displayWinCondition()
Game-->Player: confirmGameFinish()
deactivate Player

Game->Board: confirmGameFinish()
Board-->Game: confirmGameFinish()
deactivate Board
deactivate Game
@enduml

You might also like