TeaseAI_CE.Scripting.Controller.Add C# (CSharp) Method

Add() public method

Enqueue a root block to be added to the stack.
public Add ( BlockBase root ) : void
root BlockBase
return void
		public void Add(BlockBase root)
		{
			if (root == null)
			{
				Logger.Log(null, Logger.Level.Error, StringsScripting.Script_null_add_stack);
				return;
			}
			lock (queue)
			{
				queue.Add(new Context(this, root, root, 0, new Dictionary<string, Variable>()));

				if (queue.Count > 128)
				{
					root.Log.ErrorF(StringsScripting.Formatted_Queue_too_big, 128);
					queue.Clear();
				}
			}
		}
		public bool AddFromStartQuery(Logger log)

Same methods

Controller::Add ( IEvent e ) : void

Usage Example

Example #1
0
		private void validateScript(Controller c, Script s, Dictionary<string, Variable> vars, StringBuilder output)
		{
			// if script has never been validated, but has errors, then do not validate, they are parse errors.
			if (s.Valid == BlockBase.Validation.NeverRan && s.Log.ErrorCount > 0)
			{
				s.SetValid(false); // will set valid to failed.
				return;
			}

			s.SetValid(true);
			if (s.List)
			{
				vars.Clear();
				s.ExecuteAsList(new Context(c, s, s, 0, vars), output);
			}
			else
			{
				c.Add(s);
				while (c.next(output))
				{

				}
			}
			s.SetValid(false);
		}
All Usage Examples Of TeaseAI_CE.Scripting.Controller::Add