Exemplo n.º 1
0
 private void ProcessCommands()
 {
     if (currentAnimation != null && !currentAnimation.IsFinished) // command is in progress
     {
         return;
     }
     if (currentAnimation != null && currentAnimation.IsFinished) // command finishes
     {
         currentAnimation = null;
         if (NetInterface.Get().localPlayer != null)
         {
             NetInterface.Get().localPlayer.RemoveLock(playingAnimationsLock);
         }
     }
     if (animationQueue.Count == 0) // command is finished but there is no new command
     {
         return;
     }
     currentAnimation = animationQueue.Dequeue(); // start new command
     if (NetInterface.Get().localPlayer != null)
     {
         NetInterface.Get().localPlayer.AddLock(playingAnimationsLock);
     }
     currentAnimation.Execute();
 }
Exemplo n.º 2
0
 private void MoveToNextCommand()
 {
     currentCommand = commandList.Dequeue();
     currentCommand.Execute();
 }