コード例 #1
0
            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);
            }
コード例 #2
0
            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);
            }
コード例 #3
0
        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));
        }
コード例 #4
0
 public abstract bool Process(ICharacter owner, IInputCommand command, string[] args, out InputCommandResult result);
コード例 #5
0
 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);
 }
コード例 #6
0
ファイル: CommandProcess.cs プロジェクト: ramseur/MudDesigner
 public abstract bool Process(ICharacter owner, IInputCommand command, string[] args, out InputCommandResult result);