Minor Server cleanups

pull/1/merge
Thibault Duplessis 2012-03-05 02:40:48 +01:00
parent 8c72455d21
commit 8342a07869
1 changed files with 1 additions and 3 deletions

View File

@ -23,7 +23,7 @@ final class Server(repo: GameRepo, ai: Ai) {
(newChessGame, move) = newChessGameAndMove
g3 = g2.update(newChessGame, move)
g4 if (g3.player.isAi) aiResponse(g3) else success(g3)
result unsafe { repo save g4 }
_ unsafe { repo save g4 }
} yield newChessGame.situation.destinations
private def aiResponse(dbGame: DbGame): Valid[DbGame] = for {
@ -31,8 +31,6 @@ final class Server(repo: GameRepo, ai: Ai) {
(newChessGame, move) = newChessGameAndMove
} yield dbGame.update(newChessGame, move)
private def moveToEvents(move: Move): Map[DbPlayer, EventStack] = Map.empty
private def decodeMoveString(moveString: String): Option[(String, String)] =
moveString match {
case MoveString(orig, dest) (orig, dest).some