Beispiel #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());
            }
Beispiel #2
0
            public IState Handle(StateCommand command, GameManager gm)
            {
                if (!command.IsPressed)
                {
                    return(null);
                }

                gm.Hold();
                return(new HeldState());
            }
Beispiel #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));
            }
Beispiel #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));
 }
Beispiel #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));
            }
Beispiel #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);
            }