Skip to content

Commit

Permalink
ktfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssaruth committed Nov 12, 2024
1 parent 9013876 commit 51edabf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions server/src/main/kotlin/room/Room.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ data class Room(
}

fun removePlayer(username: String, fireLobbyChanged: Boolean) {
for (playerNumber in 0..<capacity) {
for (playerNumber in 0 ..< capacity) {
val user: String? = hmPlayerByPlayerNumber[playerNumber]
if ((user != null && (username == user))) {
hmPlayerByPlayerNumber.remove(playerNumber)
Expand Down Expand Up @@ -179,7 +179,7 @@ data class Room(
@JvmOverloads
fun resetCurrentPlayers(fireLobbyChanged: Boolean = true) {
currentPlayers.clear()
for (i in 0..<capacity) {
for (i in 0 ..< capacity) {
val username: String? = hmPlayerByPlayerNumber[i]
if (username != null) {
currentPlayers.add(username)
Expand Down Expand Up @@ -218,7 +218,7 @@ data class Room(

val details = HandDetails()
val hmHandSizeByPlayerNumber = ExtendedConcurrentHashMap<Int, Int>()
for (i in 0..<capacity) {
for (i in 0 ..< capacity) {
hmHandSizeByPlayerNumber[i] = 5
}

Expand Down Expand Up @@ -341,9 +341,9 @@ data class Room(
seed,
)

for (i in 0..<capacity) {
for (i in 0 ..< capacity) {
val size: Int = hmHandSizeByPlayerNumber.getValue(i)
val hand = (0..<size).map { deck.removeAt(0) }
val hand = (0 ..< size).map { deck.removeAt(0) }
hmHandByPlayerNumber[i] = hand
}

Expand All @@ -354,7 +354,7 @@ data class Room(
var activePlayers = 0
var potentialWinner = 0

for (i in 0..<capacity) {
for (i in 0 ..< capacity) {
val handSize: Int = hmHandSizeByPlayerNumber.getValue(i)
if (handSize > 0) {
activePlayers++
Expand Down
1 change: 0 additions & 1 deletion server/src/test/kotlin/room/RoomTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package room

import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
import testCore.AbstractTest
import util.makeGameSettings
Expand Down

0 comments on commit 51edabf

Please sign in to comment.