Skip to content
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

Merged
merged 2 commits into from
Nov 5, 2023
Merged

1.實作遊戲結束功能 #185

merged 2 commits into from
Nov 5, 2023

Conversation

ted791029
Copy link
Contributor

Why need this change? / Root cause:

  • end-game

Changes made:

  • Room related

Test Scope / Change impact:

  • RoomController

Issue

2.實作遊戲結束推播
@ted791029 ted791029 requested a review from Wally5077 November 1, 2023 14:19
@@ -83,6 +94,14 @@ class Room(

private fun findPlayer(playerId: Player.Id): Player? = players.find { it.id == playerId }

private fun playersCancelReady() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cancelReadyForNonHostPlayers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修正

Comment on lines 520 to 528
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
}

Copy link
Collaborator

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
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修正

@ted791029 ted791029 requested a review from frankvicky November 5, 2023 03:31
Copy link

sonarqubecloud bot commented Nov 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ted791029 ted791029 merged commit b1a2839 into main Nov 5, 2023
5 checks passed
@ted791029 ted791029 deleted the feature/end-game branch November 5, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants