scalafmt all
This commit is contained in:
@@ -37,8 +37,8 @@ object Models {
|
||||
|
||||
enum RoundState derives Codec.AsObject:
|
||||
|
||||
/** view state for round before votes are open player can know their vote
|
||||
* and who of the other players have voted
|
||||
/** view state for round before votes are open player can know their vote and who of the other
|
||||
* players have voted
|
||||
*/
|
||||
case Voting(
|
||||
myCard: Option[String],
|
||||
|
||||
@@ -4,5 +4,6 @@ import io.circe.generic.semiauto._
|
||||
import io.circe._
|
||||
|
||||
object Requests {
|
||||
final case class LogIn(roomName: String, nickname: String, password: String) derives Codec.AsObject
|
||||
final case class LogIn(roomName: String, nickname: String, password: String)
|
||||
derives Codec.AsObject
|
||||
}
|
||||
|
||||
@@ -3,104 +3,104 @@ package industries.sunshine.planningpoker
|
||||
import industries.sunshine.planningpoker.common.Models.*
|
||||
|
||||
object TestModels {
|
||||
val me = Player("wormy", PlayerID(1))
|
||||
val pony = Player("pony", PlayerID(10))
|
||||
val birdy = Player("birdy", PlayerID(11))
|
||||
val horsey = Player("horsey", PlayerID(12))
|
||||
val me = Player("wormy", PlayerID(1))
|
||||
val pony = Player("pony", PlayerID(10))
|
||||
val birdy = Player("birdy", PlayerID(11))
|
||||
val horsey = Player("horsey", PlayerID(12))
|
||||
|
||||
val testRoom = {
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("s"), alreadyVoted = List(me, pony)),
|
||||
canCloseRound = true
|
||||
)
|
||||
}
|
||||
val testOpenedRoom = {
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Viewing(
|
||||
List(me.id -> "xs", pony.id -> "l", birdy.id -> "s", horsey.id -> "m")
|
||||
),
|
||||
canCloseRound = true
|
||||
)
|
||||
}
|
||||
|
||||
val testChangesList = List(
|
||||
RoomStateView(
|
||||
players = List(me),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = None, alreadyVoted = List.empty),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = None, alreadyVoted = List.empty),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = None, alreadyVoted = List.empty),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = None, alreadyVoted = List(birdy)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy, horsey)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy, horsey, pony)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Viewing(
|
||||
List(me.id -> "m", pony.id -> "l", birdy.id -> "s", horsey.id -> "m")
|
||||
),
|
||||
canCloseRound = true
|
||||
)
|
||||
val testRoom = {
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("s"), alreadyVoted = List(me, pony)),
|
||||
canCloseRound = true
|
||||
)
|
||||
}
|
||||
val testOpenedRoom = {
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Viewing(
|
||||
List(me.id -> "xs", pony.id -> "l", birdy.id -> "s", horsey.id -> "m")
|
||||
),
|
||||
canCloseRound = true
|
||||
)
|
||||
}
|
||||
|
||||
val testChangesList = List(
|
||||
RoomStateView(
|
||||
players = List(me),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = None, alreadyVoted = List.empty),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = None, alreadyVoted = List.empty),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = None, alreadyVoted = List.empty),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = None, alreadyVoted = List(birdy)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy, horsey)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Voting(myCard = Some("m"), alreadyVoted = List(birdy, horsey, pony)),
|
||||
canCloseRound = true
|
||||
),
|
||||
RoomStateView(
|
||||
players = List(me, birdy, pony, horsey),
|
||||
me = me.id,
|
||||
allowedCards = List("xs", "s", "m", "l", "xl"),
|
||||
round = RoundState.Viewing(
|
||||
List(me.id -> "m", pony.id -> "l", birdy.id -> "s", horsey.id -> "m")
|
||||
),
|
||||
canCloseRound = true
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user