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(); }
private void MoveToNextCommand() { currentCommand = commandList.Dequeue(); currentCommand.Execute(); }