Exemplo n.º 1
0
 protected void RecursiveCancel()
 {
     if (ReturnTo != null)
     {
         ReturnTo.InnerCancel();
         ReturnTo.RecursiveCancel();
         ReturnTo = null;
     }
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 /// <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);
     }
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public AdminModifyInput(StandardHeldPrompt calledBy, Client user, IModifiable modifiedObject, ModifiableParser parser) : base(calledBy, null, user)
 {
     objectToModify = modifiedObject;
     fieldParser    = parser;
 }
Exemplo n.º 6
0
 /// <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;
 }
Exemplo n.º 7
0
 //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;
 }
Exemplo n.º 8
0
 public DeleteCharacterPrompt(StandardHeldPrompt calledBy) : base(calledBy)
 {
 }
Exemplo n.º 9
0
 public NewCharacterNamePrompt(StandardHeldPrompt calledBy, MOB mob) : base(calledBy)
 {
     newChar = mob;
 }
Exemplo n.º 10
0
 public ConfirmNewCharacterMenu(StandardHeldPrompt calledBy, MOB mob) : base(calledBy)
 {
     newChar = mob;
 }
Exemplo n.º 11
0
 protected MenuPrompt(StandardHeldPrompt calledBy, MOB character, Client player) : base(calledBy, character, player)
 {
 }
Exemplo n.º 12
0
 protected MenuPrompt(StandardHeldPrompt calledBy, MOB character = null) : base(calledBy, character)
 {
 }
Exemplo n.º 13
0
 public NewCharacterPrompt(StandardHeldPrompt calledBy) : base(calledBy)
 {
     newChar = new MOB();
 }
Exemplo n.º 14
0
 public ConfirmDeleteCharacter(MOB mob, StandardHeldPrompt previous) : base(previous)
 {
     selectedMOB = mob;
 }
Exemplo n.º 15
0
 public LoggedInMenu(StandardHeldPrompt calledBy) : base(calledBy)
 {
 }