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

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