Example #1
0
        protected bool CommandCheck(string command)
        {
            List <char> charList = new List <char>();

            for (int index = 0; index < command.Length; ++index)
            {
                charList.Add(command[index]);
            }
            for (int index1 = 0; index1 < charList.Count; ++index1)
            {
                Button buttun = Button.Esc;
                int    index2 = charList.Count - 1 - index1;
                if (charList[index2] == 'A')
                {
                    buttun = Button._A;
                }
                if (charList[index2] == 'B')
                {
                    buttun = Button._B;
                }
                if (charList[index2] == 'R')
                {
                    buttun = Button._R;
                }
                if (charList[index2] == 'L')
                {
                    buttun = Button._L;
                }
                if (charList[index2] == 's')
                {
                    buttun = Button._Select;
                }
                if (charList[index2] == 'S')
                {
                    buttun = Button._Start;
                }
                if (charList[index2] == '上')
                {
                    buttun = Button.Up;
                }
                if (charList[index2] == '右')
                {
                    buttun = Button.Right;
                }
                if (charList[index2] == '左')
                {
                    buttun = Button.Left;
                }
                if (charList[index2] == '下')
                {
                    buttun = Button.Down;
                }
                if (this.commandList[index1] != buttun)
                {
                    return(false);
                }
            }
            return(true);
        }
Example #2
0
 protected void CommandAdd(Button button)
 {
     for (int index = 0; index < this.commandList.Length - 1; ++index)
     {
         this.commandList[this.commandList.Length - index - 1] = this.commandList[this.commandList.Length - index - 2];
     }
     this.commandList[0] = button;
 }