/** * Removes Generic Operator from parents * */ protected void RemoveParent(GenericOperator parent) { if (Parents.Contains(parent)) { Parents.Remove(parent); } }
/** * Removes Generic Operator from children * */ protected void RemoveChild(GenericOperator child) { if (Children.Contains(child)) { Children.Remove(child); } }
/** * 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(); } }
private IEnumerator spawnNewOperatorAfterNewlyCreatedOperatorHasFinishedProcess() { while (processComplete == false) { yield return(new WaitForFixedUpdate()); } newOperator = Observer.spawnNewOperator(this); }
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); }
private void InstallComponents(GenericOperator op) { if (op.GetIcon() != null) { _graphSpaceController.InstallNewIcon(op); } if (!op.GetType().Equals((typeof(NewOperator)))) { selectOperator(op); } }
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; }
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(); }
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); }
public abstract bool ValidateIfOperatorPossibleForParents(GenericOperator parent);
/** * Adds Generic Operator to parents * */ protected void AddParent(GenericOperator parent) { Parents.Add(parent); }
/** * Adds Generic Operator to children * */ protected void AddChild(GenericOperator child) { Children.Add(child); }