-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.實作遊戲結束功能 #185
1.實作遊戲結束功能 #185
Conversation
2.實作遊戲結束推播
@@ -83,6 +94,14 @@ class Room( | |||
|
|||
private fun findPlayer(playerId: Player.Id): Player? = players.find { it.id == playerId } | |||
|
|||
private fun playersCancelReady() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cancelReadyForNonHostPlayers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修正
private fun givenPlayersArePlayingInRoom(host: Player, vararg players: Player): Room { | ||
val combinedPlayers = (listOf(host) + players).toMutableList() | ||
players.forEach { player -> | ||
player.ready() | ||
} | ||
testRoom = createRoom(host = host, players = combinedPlayers, status = PLAYING) | ||
return testRoom | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private fun givenPlayersArePlayingInRoom(host: Player, vararg players: Player): Room {
players.forEach { it.ready() }
val allPlayers = mutableListOf(host, *players)
testRoom = createRoom(host = host, players = allPlayers, status = PLAYING)
return testRoom
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修正
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Why need this change? / Root cause:
Changes made:
Test Scope / Change impact:
Issue
POST /rooms/{roomId}:endGame
#184