OSDN Git Service

Commandクラスから一部メンバーを削除した
authorkonekoneko <jbh03215@gmail.com>
Tue, 16 Oct 2012 05:51:26 +0000 (14:51 +0900)
committerkonekoneko <jbh03215@gmail.com>
Tue, 16 Oct 2012 05:51:26 +0000 (14:51 +0900)
public/scripts/commandparser.js

index f45a121..024e49b 100644 (file)
@@ -3,8 +3,12 @@
 //\r
 function CommandParser()\r
 {\r
-       this.word = new Array;\r
+       //\83R\83}\83\93\83h\83\8a\83X\83g\82ð\95\\82·\r
+       //\83R\83}\83\93\83h\83\8a\83X\83g\82Ì\8ae\97v\91f\82É\82Ífunction(msg,word){}\82ð\92Ç\89Á\82µ\82È\82¯\82ê\82Î\82È\82ç\82È\82¢\r
+       //\97á\81j/test\83R\83}\83\93\83h\82ð\92Ç\89Á\r
+       //this.CommandList["test"] = function(msg,word){}\r
        this.CommandList;\r
+       //\82Ç\82Ì\83R\83}\83\93\83h\82É\82à\8aY\93\96\82µ\82È\82¢\8e\9e\82É\8cÄ\82Ñ\82³\82ê\82é\8aÖ\90\94\r
        this.DefaultCommand = function(msg)\r
        {\r
                return msg.message;\r
@@ -12,9 +16,9 @@ function CommandParser()
 \r
        this.parse = function(msg)\r
        {\r
-               this.word = msg.message.split(" ");\r
-               if(this.CommandList[this.word[0]])\r
-                       return this.CommandList[this.word[0]](msg,this.word);\r
+               var word = msg.message.split(" ");\r
+               if(this.CommandList[word[0]])\r
+                       return this.CommandList[word[0]](msg,word);\r
                else\r
                        return this.DefaultCommand(msg);\r
        }\r