public override bool Process(ICharacter owner, IInputCommand command, string[] args, out InputCommandResult result) { if (args.Length == 0) { result = new InputCommandResult("Invalid password\r\n name: ", false, command, owner); return(false); } result = new InputCommandResult("Login Successful\r\n", this.GetNextProcessor() != null, command, owner); return(true); }
public override bool Process(ICharacter owner, IInputCommand command, string[] args, out InputCommandResult result) { if (args.Length == 0 || string.IsNullOrWhiteSpace(args[0])) { result = new InputCommandResult("You must enter a character name.", false, command, owner); return(false); } this.notificationManager.Publish(new InformationMessage("Please enter your character's password: ", owner)); result = new InputCommandResult(false, command, owner); return(true); }
public Task <InputCommandResult> ExecuteAsync(ICharacter owner, params string[] args) { InputCommandResult result = null; if (this.currentProcessor.Process(owner, this, args, out result)) { this.currentProcessor = this.currentProcessor.GetNextProcessor(); if (result.IsCommandCompleted) { this.notificationManager.Publish(new NewCharacterCreatedMessage("Character created.", owner)); } } return(Task.FromResult(result)); }
public abstract bool Process(ICharacter owner, IInputCommand command, string[] args, out InputCommandResult result);
public override bool Process(ICharacter owner, IInputCommand command, string[] args, out InputCommandResult result) { this.notificationCenter.Publish(new InformationMessage("Please enter your character name: ", owner)); result = new InputCommandResult(false, command, owner); return(true); }