add IamReadyToPlayCommand & refactoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package eventDemo.app.entity
|
||||
|
||||
import eventDemo.configuration.UUIDSerializer
|
||||
import eventDemo.shared.UUIDSerializer
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import java.util.UUID
|
||||
|
||||
15
src/main/kotlin/eventDemo/app/entity/GameId.kt
Normal file
15
src/main/kotlin/eventDemo/app/entity/GameId.kt
Normal file
@@ -0,0 +1,15 @@
|
||||
package eventDemo.app.entity
|
||||
|
||||
import eventDemo.libs.event.AggregateId
|
||||
import eventDemo.shared.GameIdSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* An [AggregateId] for a game.
|
||||
*/
|
||||
@JvmInline
|
||||
@Serializable(with = GameIdSerializer::class)
|
||||
value class GameId(
|
||||
override val id: UUID = UUID.randomUUID(),
|
||||
) : AggregateId
|
||||
@@ -1,8 +1,8 @@
|
||||
package eventDemo.app.entity
|
||||
|
||||
import eventDemo.configuration.PlayerIdSerializer
|
||||
import eventDemo.configuration.UUIDSerializer
|
||||
import eventDemo.libs.event.AggregateId
|
||||
import eventDemo.shared.PlayerIdSerializer
|
||||
import eventDemo.shared.UUIDSerializer
|
||||
import io.ktor.server.auth.Principal
|
||||
import kotlinx.serialization.Serializable
|
||||
import java.util.UUID
|
||||
@@ -26,11 +26,3 @@ data class Player(
|
||||
override fun toString(): String = id.toString()
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class PlayerHand(
|
||||
val player: Player,
|
||||
val cards: List<Card> = emptyList(),
|
||||
) {
|
||||
val count = lazy { cards.count() }
|
||||
}
|
||||
|
||||
11
src/main/kotlin/eventDemo/app/entity/PlayerHand.kt
Normal file
11
src/main/kotlin/eventDemo/app/entity/PlayerHand.kt
Normal file
@@ -0,0 +1,11 @@
|
||||
package eventDemo.app.entity
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class PlayerHand(
|
||||
val player: Player,
|
||||
val cards: List<Card> = emptyList(),
|
||||
) {
|
||||
val count = lazy { cards.count() }
|
||||
}
|
||||
Reference in New Issue
Block a user