Exemplo n.º 1
0
 /**
  * Removes Generic Operator from parents
  * */
 protected void RemoveParent(GenericOperator parent)
 {
     if (Parents.Contains(parent))
     {
         Parents.Remove(parent);
     }
 }
Exemplo n.º 2
0
 /**
  * Removes Generic Operator from children
  * */
 protected void RemoveChild(GenericOperator child)
 {
     if (Children.Contains(child))
     {
         Children.Remove(child);
     }
 }
Exemplo n.º 3
0
 /**
  * Deletes recursively all children that do not have any other parent and refreshes all children that
  * do have other parents. Deletes itself including icon and visualization.
  * */
 public void Delete(GenericOperator op)
 {
     if (op.Equals(this) || Parents.Count == 1)
     {
         if (Parents != null)
         {
             foreach (var parent in Parents)
             {
                 parent.RemoveChild(op);
             }
         }
         if (Children != null)
         {
             foreach (var child in Children)
             {
                 child.Delete(this);
             }
         }
         DestroyGenericOperator();
     }
     else
     {
         RemoveParent(op);
         Fetchdata();
         Process();
     }
 }
Exemplo n.º 4
0
 private IEnumerator spawnNewOperatorAfterNewlyCreatedOperatorHasFinishedProcess()
 {
     while (processComplete == false)
     {
         yield return(new WaitForFixedUpdate());
     }
     newOperator = Observer.spawnNewOperator(this);
 }
Exemplo n.º 5
0
        public GenericOperator spawnNewOperator(GenericOperator op)
        {
            List <GenericOperator> parent = new List <GenericOperator>();

            parent.Add(op);
            GameObject      ob = CreateOperator(_operatorPrefabs[_operatorNewId], parent);
            GenericOperator go = ob.GetComponent <GenericOperator>();


            return(go);
        }
Exemplo n.º 6
0
        private void InstallComponents(GenericOperator op)
        {
            if (op.GetIcon() != null)
            {
                _graphSpaceController.InstallNewIcon(op);
            }

            if (!op.GetType().Equals((typeof(NewOperator))))
            {
                selectOperator(op);
            }
        }
Exemplo n.º 7
0
        public void selectOperator(GenericOperator go)
        {
            if (selectedOperator == go || go.GetType().Equals((typeof(NewOperator))))
            {
                return;
            }

            if (selectedOperator != null)
            {
                selectedOperator.setSelected(false);
            }
            go.setSelected(true);

            _visualizationSpaceController.InstallVisualization(go);

            selectedOperator = go;
        }
Exemplo n.º 8
0
        public void DestroyOperator(GenericOperator operatorInstance)
        {
            if (operatorInstance == null)
            {
                return;
            }
            List <GenericOperator> parents = operatorInstance.Parents;

            if (parents != null)
            {
                foreach (GenericOperator parent in parents)
                {
                    parent.Children.Remove(operatorInstance);
                }
            }

            _operators.Remove(operatorInstance);

            operatorInstance.DestroyGenericOperator();
        }
Exemplo n.º 9
0
        public void notifyObserverOperatorInitComplete(GenericOperator genericOperator)
        {
            if (!genericOperator.CheckConsistency())
            {
                throw new InvalidProgramException(
                          "base.Start() etc. methods needs to be called in respective inherited methods");
            }

            InstallComponents(genericOperator);

            genericOperator.processComplete = genericOperator.Process();

            // Emit Event after the new Operator has been initialized and the Process() function has been started
            if (NewOperatorInitializedAndRunnningEvent != null)
            {
                NewOperatorInitializedAndRunnningEvent(genericOperator);
            }


            _graphSpaceController.moveToSpawnPosition(genericOperator);
        }
Exemplo n.º 10
0
 public abstract bool ValidateIfOperatorPossibleForParents(GenericOperator parent);
Exemplo n.º 11
0
 /**
  * Adds Generic Operator to parents
  * */
 protected void AddParent(GenericOperator parent)
 {
     Parents.Add(parent);
 }
Exemplo n.º 12
0
 /**
  * Adds Generic Operator to children
  * */
 protected void AddChild(GenericOperator child)
 {
     Children.Add(child);
 }