浏览代码

Add shortcuts for the commands

Thomas Dy 11 年之前
父节点
当前提交
f9e5d644c0
共有 1 个文件被更改,包括 7 次插入11 次删除
  1. 7 11
      app/models/Taboo.scala

+ 7 - 11
app/models/Taboo.scala

@@ -123,24 +123,20 @@ class TabooGame(val chatActor: ActorRef) extends Actor {
 
     case Talk(username, text) => round match {
       case Some(round) =>
-        if(username == round.team.player) {
-          if(text == "/pass") {
-            roundActor ! Pass
-          }
-          else {
-            roundActor ! Information(text)
-          }
+        if(username == round.team.player) text match {
+          case "/pass" | "/p" => roundActor ! Pass
+          case text => roundActor ! Information(text)
         }
         else if(round.team.guessers(username)) {
           roundActor ! Guess(username, text)
         }
-        else if(round.monitors(username) && text == "/taboo") {
-          roundActor ! Taboo(username)
+        else if(round.monitors(username)) text match {
+          case "/taboo" | "/t" => roundActor ! Taboo(username)
         }
 
       case None =>
-        if(username == currentTeam.player && text == "/start") {
-          self ! StartRound
+        if(username == currentTeam.player) text match {
+          case "/start" | "/s" => self ! StartRound
         }
     }