public void TryStartCommandList(List <CommandUI> commandList)
    {
        CommandList.Clear();

        _currentCommandLine = 0;
        _findError          = false;

        CommandStartError += StopStartCommandList;

        foreach (var container in commandList)
        {
            if (_findError)
            {
                break;
            }

            BaseCommand newCommand;
            if (TryGetRealCommand(container, out newCommand))
            {
                CommandList.Enqueue(newCommand);
            }
        }

        CommandStartError -= StopStartCommandList;
    }
Exemple #2
0
        public void Update()
        {
            try
            {
                PADTAG ptag = PADTAG.PADKEY_RELEASE;
                KEYTAG ktag = KEYTAG.GAMEKEY_NONE;
                //GamePadState state = GamePad.GetState(PlayerIndex);
                if (vjoy.joydir.x < -0.5f)
                {
                    ptag -= 1 * dir;
                }
                if (vjoy.joydir.x > 0.5f)
                {
                    ptag += 1 * dir;
                }

                if (vjoy.joydir.y < -0.5f)
                {
                    ptag -= 3;
                }
                if (vjoy.joydir.y > 0.5f)
                {
                    ptag += 3;
                }
                if (vjoy.btnInfo[0].bdown || vjoy.btnInfo[2].bdown)//J or L
                {
                    ktag |= KEYTAG.GAMEKEY_1;
                }
                if (vjoy.btnInfo[1].bdown || vjoy.btnInfo[2].bdown)//K or L
                {
                    ktag |= KEYTAG.GAMEKEY_2;
                }


                if (last.padtag != (byte)ptag || last.keytag != (byte)ktag)
                {
                    last.padtag = (byte)ptag;
                    last.keytag = (byte)ktag;
                    CommandList.Enqueue(last);
                    //Debug.Log("last=" + last);
                }
            }
            catch
            {
                ErrorCount = ErrorCount + 1;
            }
        }