示例#1
0
        public void RegisterElement(Element e)
        {
            if (controlVars.ContainsKey(e.Id))
            {
                throw new ArgumentException("Element already registred.");
            }
            if (e.Id <= STATIC_CONTROL_VARS_ID)
            {
                throw new ArgumentException("Element id lower than " + STATIC_CONTROL_VARS_ID);
            }

            controls.Add(e.Id, e);
            if (e.NumControlInputs != 0)
            {
                int[] Array = new int[e.NumControlInputs];
                for (int i = 0; i < Array.Length; ++i)
                {
                    Array[i] = 0;
                }
                controlVars.Add(e.Id, Array);
            }
            else
            {
                controlVars.Add(e.Id, null);
            }
        }
示例#2
0
 public void SetData(int data,Element by)
 {
     this.data = data;
     changed = true;
 }
示例#3
0
 public void AddOutputTarget(Element e)
 {
     outputTargets.AddLast(e);
 }
示例#4
0
 public bool RemoveOutputTarget(Element e)
 {
     return outputTargets.Remove(e);
 }