protected void RecursiveCancel()
 {
     if (ReturnTo != null)
     {
         ReturnTo.InnerCancel();
         ReturnTo.RecursiveCancel();
         ReturnTo = null;
     }
 }
 public AdminModifyField(StandardHeldPrompt previous, Client client, IModifiable target, ModifiableParser parser) : base(previous, null, client)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (parser == null)
     {
         throw new ArgumentNullException("parser");
     }
     objectToModify = target;
     fieldParser    = parser;
 }
 /// <summary>
 /// Attempt to transition to the next prompt. This must be called during the prompt, and there must not be a next prompt yet.
 /// Caller still needs to finish processing the current prompt to continue to the next prompt.
 /// </summary>
 /// <param name="nextPrompt"></param>
 /// <param name="setThisAsReturn">Attempts to Note: No warning is given if this fails.</param>
 /// <returns>True if this will call the next prompt, else false.</returns>
 public bool TransitionTo(StandardHeldPrompt nextPrompt, bool setThisAsReturn)
 {
     if (TransitionTo(nextPrompt))
     {
         if (setThisAsReturn && nextPrompt != null && nextPrompt.ReturnTo == null)
         {
             nextPrompt.ReturnTo = this;
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
        public AdminSelectModify(StandardHeldPrompt previous, Client client, IModifiable target) : base(previous, null, client)
        {
            objectToModify = target;
            Metadata meta = Metadata.LoadedClasses[target.GetType()];

            ModifiableParser[] parsers = meta.GetModifyParsers();
            string             quit    = "Quit";

            foreach (ModifiableParser parser in parsers)
            {
                string parserName = parser.Name(target);
                if (parserName.Equals(quit, StringComparison.InvariantCultureIgnoreCase))
                {
                    parserName = "Field" + parserName;
                }
                AddOption(parser.Description(target), ModifyField, parser, parserName);
            }
            AddOption("Finished editing this object.", EndThisPromptOption, null, quit);
        }
Exemple #5
0
 public AdminModifyInput(StandardHeldPrompt calledBy, Client user, IModifiable modifiedObject, ModifiableParser parser) : base(calledBy, null, user)
 {
     objectToModify = modifiedObject;
     fieldParser    = parser;
 }
 /// <summary>
 /// Create a 'subprompt' that will return to the previous prompt when this one is finished.
 /// </summary>
 /// <param name="calledBy"></param>
 public StandardHeldPrompt(StandardHeldPrompt calledBy, MOB character, Client player)
 {
     ReturnTo      = calledBy;
     User          = player;
     AssociatedMOB = character;
 }
 //public StandardHeldPrompt() { }
 /// <summary>
 /// Create a 'subprompt' that will return to the previous prompt when this one is finished.
 /// </summary>
 /// <param name="calledBy"></param>
 public StandardHeldPrompt(StandardHeldPrompt calledBy, MOB character = null)
 {
     ReturnTo      = calledBy;
     User          = calledBy?.User;
     AssociatedMOB = character;
 }
Exemple #8
0
 public DeleteCharacterPrompt(StandardHeldPrompt calledBy) : base(calledBy)
 {
 }
Exemple #9
0
 public NewCharacterNamePrompt(StandardHeldPrompt calledBy, MOB mob) : base(calledBy)
 {
     newChar = mob;
 }
Exemple #10
0
 public ConfirmNewCharacterMenu(StandardHeldPrompt calledBy, MOB mob) : base(calledBy)
 {
     newChar = mob;
 }
Exemple #11
0
 protected MenuPrompt(StandardHeldPrompt calledBy, MOB character, Client player) : base(calledBy, character, player)
 {
 }
Exemple #12
0
 protected MenuPrompt(StandardHeldPrompt calledBy, MOB character = null) : base(calledBy, character)
 {
 }
 public NewCharacterPrompt(StandardHeldPrompt calledBy) : base(calledBy)
 {
     newChar = new MOB();
 }
 public ConfirmDeleteCharacter(MOB mob, StandardHeldPrompt previous) : base(previous)
 {
     selectedMOB = mob;
 }
Exemple #15
0
 public LoggedInMenu(StandardHeldPrompt calledBy) : base(calledBy)
 {
 }