public Command InterpretRequest(string command) { Command interpretation; if (command.Equals(TextCommands.SHOWREGISTERED, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandShowRegistered(); } else if (command.Equals(TextCommands.SHOWLOGGED, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandShowLogged(); } else if (command.Equals(TextCommands.STARTMATCH, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandStartMatch(); } else if (command.Equals(TextCommands.EXIT, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandExit(); } else { interpretation = new CommandUnknown(); } return(interpretation); }
public Command InterpretRequest(string command) { Command interpretation; if (command.Equals(TextCommands.REGISTER, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandRegister(); } else if (command.Equals(TextCommands.LOGIN, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandLogin(); } else if (command.Equals(TextCommands.LOGOUT, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandLogOut(); } else if (command.Equals(TextCommands.JOINMATCH, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandJoin(); } else if (command.Equals(TextCommands.SELECTCHARACTER, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandSelect(); } else if (command.Equals(TextCommands.MOVE, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandMove(); } else if (command.Equals(TextCommands.ATTACK, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandAttack(); } else if (command.Equals(TextCommands.EXIT, StringComparison.InvariantCultureIgnoreCase)) { interpretation = new CommandExit(); } else { interpretation = new CommandUnknown(); } return(interpretation); }