void SetupImplementors( Action <FasterList <INode> > removeEntity, Action <FasterList <INode> > enableEntity, Action <FasterList <INode> > disableEntity, FasterList <INode> nodes) { Action removeEntityAction = () => { removeEntity(nodes); nodes.Clear(); }; Action disableEntityAction = () => disableEntity(nodes); Action enableEntityAction = () => enableEntity(nodes); for (int index = 0; index < _removingImplementors.Count; index++) { _removingImplementors[index].removeEntity = removeEntityAction; } for (int index = 0; index < _disablingImplementors.Count; index++) { _disablingImplementors[index].disableEntity = disableEntityAction; } for (int index = 0; index < _enablingImplementors.Count; index++) { _enablingImplementors[index].enableEntity = enableEntityAction; } }
public virtual FasterList <INode> BuildNodes(int ID, Action <INode> removeAction) { var nodes = new FasterList <INode>(); for (int index = 0; index < _nodesToBuild.Length; index++) { var nodeBuilder = _nodesToBuild[index]; var node = FillNode(nodeBuilder.Build(ID), () => { for (int i = 0; i < nodes.Count; i++) { removeAction(nodes[i]); } nodes.Clear(); } ); nodes.Add(node); } return(nodes); }