// if user has inputed, then do the responding work
 public void userHasInput(string userInput)
 {
     if (userInput.Equals(MoveLeftCommand))
     {
         tm.setState(tm.MoveLeftState);
         tm.MoveLeft(tv.GetNowBlock());
     }
     else if (userInput.Equals(MoveLeftCommand))
     {
         tm.setState(tm.MoveRightState);
         tm.MoveRight(tv.GetNowBlock(), tv.GetAllBlocks());
     }
     else if (userInput.Equals(MoveDownFastCommand))
     {
         tm.setState(tm.MoveDownFastState);
         tm.DropDownFast(tv.GetNowBlock(), tv.GetAllBlocks());
     }
     else if (userInput.Equals(RotateCommand))
     {
         tm.setState(tm.RotateState);
         tm.Rotate(tv.GetNowBlock(), tv.GetAllBlocks());
     }
 }
Exemple #2
0
 // let game start
 public void start()
 {
     tm.setState(tm.IdleState);
 }