Пример #1
0
		public Variable Get(Key key, Logger log = null)
		{
			if (key.AtEnd)
				return new Variable<BlockBase>(this);
			Logger.LogF(log, Logger.Level.Error, StringsScripting.Formatted_Variable_not_found, key);
			return null;
		}
Пример #2
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);
		}
Пример #3
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);
		}
Пример #4
0
		public Variable Get(Key key, Logger log = null)
		{
			if (key.AtEnd)
			{
				Logger.LogF(log, Logger.Level.Error, StringsScripting.Formatted_IKeyed_Cannot_return_self, key, GetType());
				return null;
			}
			switch (key.Peek)
			{
				case "personality":
					return personalities.Get(++key, log);
				case "script":
					return allscripts.Get(key, log);
				case "list":
					return allscripts.Get(key, log);
				default:
					{
						Function func;
						if (functions.TryGetValue(key.Peek, out func))
							return new Variable(func);
						Logger.LogF(log, Logger.Level.Error, StringsScripting.Formatted_Function_not_found, key);
						return null;
					}
			}
		}
Пример #5
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);
		}
Пример #6
0
		public virtual Variable Get(Key key, Logger log = null)
		{
			if (key.AtEnd)
				return this;
			if (!IsSet)
			{
				Logger.LogF(log, Logger.Level.Error, StringsScripting.Formatted_IKeyedGet_Variable_Unset, key);
				return null;
			}
			IKeyed value = Value as IKeyed;
			if (value == null)
			{
				Logger.LogF(log, Logger.Level.Error, StringsScripting.Formatted_Variable_not_found, key);
				return null;
			}
			return value.Get(key, log);
		}