Esempio n. 1
0
 public CommandEntry AddCommand(CommandTokenMatcher Matcher)
 {
     var Entry = new CommandEntry { Matcher = Matcher };
     Entry.ManualName = Matcher.FindFirstKeyWord();
     Commands.Add(Entry);
     return Entry;
 }
Esempio n. 2
0
 public static void ProcessPlayerCommand(CommandEntry Command, PossibleMatch Match, Actor Actor)
 {
     ExecutingCommand = Match;
     try
     {
         ExecuteCommand(Command, Match, Actor);
     }
     finally
     {
         ExecutingCommand = null;
     }
 }
			public MatchedCommand(CommandEntry Command, PossibleMatch Match)
			{
				this.Command = Command;
				this.Match = Match;
			}
        public void AddCommand(ICommandTokenMatcher Matcher, ICommandProcessor Processor, String HelpText)
        {
            var Entry = new CommandEntry { Matcher = Matcher, Processor = Processor, HelpText = HelpText };
			Commands.Add(Entry);
        }
Esempio n. 5
0
 /// <summary>
 /// Actually carryout the command, following all of it's rules, including the before and after command rules.
 /// </summary>
 /// <param name="Command"></param>
 /// <param name="Match"></param>
 /// <param name="Actor"></param>
 /// <returns>The result of the command's procedural rules.</returns>
 private static PerformResult ExecuteCommand(CommandEntry Command, PossibleMatch Match, Actor Actor)
 {
     var result = PerformResult.Stop;
     Match.Upsert("COMMAND", Command);
     if (GlobalRules.ConsiderMatchBasedPerformRule("before command", Match, Actor) == PerformResult.Continue)
     {
         result = Command.ProceduralRules.Consider(Match, Actor);
         GlobalRules.ConsiderMatchBasedPerformRule("after command", Match, Actor);
     }
     GlobalRules.ConsiderPerformRule("after every command", Actor);
     return result;
 }
 public MatchedCommand(CommandEntry Command, PossibleMatch Match)
 {
     this.Command = Command;
     this.Match   = Match;
 }
Esempio n. 7
0
 public MatchedCommand(CommandEntry Command, IEnumerable<PossibleMatch> Matches)
 {
     this.Command = Command;
     if (Matches != null)
         this.Matches = new List<PossibleMatch>(Matches);
     else
         this.Matches = new List<PossibleMatch>();
 }