public PlayerLoginCommand(INotificationCenter notificationManager) { this.passwordProcessor = new CharacterPasswordProcessor(); this.nameProcessor = new CharacterNameProcessor(notificationManager, this.passwordProcessor); this.nameRequestor = new CharacterNameRequestor(notificationManager, this.nameProcessor); this.currentProcessor = this.nameRequestor; this.notificationManager = notificationManager; }
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 CommandProcess(CommandProcess nextProcess) { this.nextProcess = nextProcess; }
public CharacterNameProcessor(INotificationCenter notificationCenter, CommandProcess nextProcessor) : base(nextProcessor) { this.notificationManager = notificationCenter; }
public CharacterPasswordProcessor(CommandProcess nextProcessor) : base(nextProcessor) { }
public CommandProcess(CommandProcess nextProcess) { this.nextProcess = nextProcess; }