Skip to content

amsterdam-scala/scala-academy-prisoner-dilemma

Repository files navigation

SErver

clients = Client(state = [WAITING, PLAYING], actorRef

GameActor(p1, p2: ActorRef)

  • schedule rounds
  • client ! StartGame
  • wait for rdy
  • send client ! StartRound(nr)
  • wait RoundAnswer
  • send result
  • repeat random #
  • FinishGame => kill himself, back to lobby

LobbyActor

  • Register(name) => WAITING
  • Unregister(name)
  • start and stop game actors

client state = [WAITING, PLAYING]

  • StartGame(id, name) => PLAYING, ! PlayerReady
  • RoundAnswer(roundNr, answer = [TALK, SILENT]]
  • RoundResult(otherPlaxerAnswer, score)
  • FinishGame(score) => state = waiting

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages