Ejemplo n.º 1
0
            public IState Handle(StateCommand command, GameManager gm)
            {
                if (command.Key != PressedKey)
                {
                    return(null);
                }

                if (!command.IsPressed)
                {
                    return(new NormalState());
                }

                if (++DelayCount <= Delay)
                {
                    return(null);
                }

                if (!gm.IsTouchDown())
                {
                    return(new NormalState());
                }

                gm.TouchDown();
                DelayCount = 0;
                return(new NormalState());
            }
Ejemplo n.º 2
0
            public IState Handle(StateCommand command, GameManager gm)
            {
                if (!command.IsPressed)
                {
                    return(null);
                }

                gm.Hold();
                return(new HeldState());
            }
Ejemplo n.º 3
0
            public IState Handle(StateCommand command, GameManager gm)
            {
                if (!command.IsPressed)
                {
                    return(null);
                }

                var(canExecute, blockExecuted) = gm.MoveCheck(command);
                if (!canExecute)
                {
                    return(null);
                }
                gm.BlockNow = blockExecuted;
                return(new DasState(command.Key));
            }
Ejemplo n.º 4
0
 public IState Handle(StateCommand command, GameManager gm)
 {
     if (command.Key != PressedKey)
     {
         return(null);
     }
     if (!command.IsPressed)
     {
         return(new NormalState());
     }
     if (++DelayCount <= Delay)
     {
         return(null);
     }
     return(new AutoShiftState(command.Key));
 }
Ejemplo n.º 5
0
            public IState Handle(StateCommand command, GameManager gm)
            {
                if (!command.IsPressed)
                {
                    return(null);
                }

                var(canExecute, blockExecuted) = gm.MoveCheck(command);
                if (!canExecute)
                {
                    return(Constants.IsDLD ? new LockDelayState(command.Key) : null);
                }

                gm.BlockNow = blockExecuted;
                return(new AutoShiftState(command.Key));
            }
Ejemplo n.º 6
0
            public IState Handle(StateCommand command, GameManager gm)
            {
                if (command.Key != PressedKey)
                {
                    return(null);
                }
                if (!command.IsPressed)
                {
                    return(new NormalState());
                }

                if (++DelayCount > Delay)
                {
                    var(canExecute, blockExecuted) = gm.MoveCheck(command);
                    if (!canExecute)
                    {
                        return(new NormalState());
                    }
                    gm.BlockNow = blockExecuted;
                    DelayCount  = 0;
                }
                return(null);
            }