NextIf() public method

public NextIf ( string key ) : bool
key string
return bool
Beispiel #1
0
		public Variable Get(Key key, Logger log = null)
		{
			if (key.AtEnd)
				return VM.Get(new Key(log, "personality", (string)id_var.Value));
			if (key.NextIf("self"))
			{
				if (key.AtEnd)
					return VM.Get(new Key(log, "personality", (string)id_var.Value));
				return variables.Get(key, log);
			}
			return VM.Get(key, log);
		}
Beispiel #2
0
		public Variable Get(Key key, Logger log = null)
		{
			if (key.NextIf("local"))
			{
				Variable result;
				if (!Variables.TryGetValue(key.Peek, out result))
					Variables[key.Peek] = result = new Variable();
				return result;
			}
			else
				return Controller.Get(key, Root.Log);
		}
Beispiel #3
0
        public Variable Get(Key key, Logger log = null)
        {
            if (key.AtEnd)
            {
                // ToDo : Error
                return(null);
            }
            if (key.NextIf("startquery"))
            {
                return(startQuery.Get(key, log));
            }
            if (key.NextIf("emptyquery"))
            {
                return(emptyQuery.Get(key, log));
            }


            var p = Personalities.GetActive();

            if (key.NextIf("contact"))
            {
                int i;
                if (!int.TryParse(key.Next(), out i))
                {
                    // ToDo : Error
                    return(null);
                }
                p = Personalities.Get(i, log);
            }

            if (p == null)
            {
                return(null);
            }
            return(p.Get(key, log));
        }
Beispiel #4
0
 public Variable Get(Key key, Logger log = null)
 {
     if (key.AtEnd)
     {
         return(VM.Get(new Key(log, "personality", (string)id_var.Value)));
     }
     if (key.NextIf("self"))
     {
         if (key.AtEnd)
         {
             return(VM.Get(new Key(log, "personality", (string)id_var.Value)));
         }
         return(variables.Get(key, log));
     }
     return(VM.Get(key, log));
 }
Beispiel #5
0
 public Variable Get(Key key, Logger log = null)
 {
     if (key.NextIf("local"))
     {
         Variable result;
         if (!Variables.TryGetValue(key.Peek, out result))
         {
             Variables[key.Peek] = result = new Variable();
         }
         return(result);
     }
     else
     {
         return(Controller.Get(key, Root.Log));
     }
 }
Beispiel #6
0
		public Variable Get(Key key, Logger log = null)
		{
			if (key.AtEnd)
			{
				// ToDo : Error
				return null;
			}
			if (key.NextIf("startquery"))
				return startQuery.Get(key, log);
			if (key.NextIf("emptyquery"))
				return emptyQuery.Get(key, log);
			if (personality == null)
				return null;
			return personality.Get(key, log);
		}