Exemplo n.º 1
0
        public void Update(PlayerButton input, Facing facing, bool paused)
        {
            m_inputbuffer.Add(input, facing);

            if (paused == false)
            {
                foreach (var count in m_commandcount.Values)
                {
                    count.Tick();
                }
            }

            foreach (var command in Commands)
            {
                if (command.IsValid == false)
                {
                    continue;
                }

                if (CommandChecker.Check(command, m_inputbuffer))
                {
                    var time = command.BufferTime;
                    if (paused)
                    {
                        ++time;
                    }

                    m_commandcount[command.Name].Set(time);
                }
            }

            m_activecommands.Clear();
            foreach (var data in m_commandcount)
            {
                if (data.Value.IsActive)
                {
                    m_activecommands.Add(data.Key);
                }
            }
        }
Exemplo n.º 2
0
        private void Test()
        {
            var command = BuildCommand("Attack", "~10$B, $F, x", 15, 1);

            var input = new InputBuffer();

            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left, Facing.Right);
            input.Add(PlayerButton.Left | PlayerButton.Right, Facing.Right);
            input.Add(PlayerButton.Right, Facing.Right);
            input.Add(PlayerButton.Right | PlayerButton.X, Facing.Right);

            var check = CommandChecker.Check(command, input);
        }