public void HandleGamePlayingRequests(string argumentOne, ChatUser chatUser, IChatClient chatClient) { lock (SingleFileLock) { if (string.IsNullOrWhiteSpace(argumentOne)) { // attempting to start a game _hangmanGame.AttemptToStartGame(chatClient, chatUser); } else if (argumentOne.Length == 1) { // asking about a letter _hangmanGame.AskAboutLetter(chatClient, argumentOne.ToLowerInvariant(), chatUser); } else { // guessing the word _hangmanGame.GuessWord(chatClient, argumentOne, chatUser); } } }
public override void Process(IChatClient chatClient, CommandReceivedEventArgs eventArgs) { string argumentOne = eventArgs?.Arguments?.FirstOrDefault(); ChatUser chatUser = eventArgs?.ChatUser; lock (SingleFileLock) { if (string.IsNullOrWhiteSpace(argumentOne)) { // attempting to start a game _hangmanGame.AttemptToStartGame(chatClient, chatUser); } else if (argumentOne.Length == 1) { // asking about a letter _hangmanGame.AskAboutLetter(chatClient, argumentOne.ToLowerInvariant(), chatUser); } else { // guessing the word _hangmanGame.GuessWord(chatClient, argumentOne, chatUser); } } }