protected override void OnGivingNodesForCombine(INodeGroup newGroup) { if (!(newGroup is IPipeNet newPipeNet)) { return; } newPipeNet.Air.Merge(Air); Air.Clear(); }
public void CombineGroup(INodeGroup newGroup) { if (newGroup.Nodes.Count < Nodes.Count) { newGroup.CombineGroup(this); return; } foreach (var node in Nodes) { node.NodeGroup = newGroup; } }
public void CombineGroup(INodeGroup newGroup) { if (newGroup.Nodes.Count < Nodes.Count) { newGroup.CombineGroup(this); return; } BeforeCombine(); newGroup.BeforeCombine(); foreach (var node in Nodes) { node.NodeGroup = newGroup; } AfterCombine(); newGroup.AfterCombine(); }
private bool TryGetWireNet(PowerReceiverComponent powerReceiver, out INodeGroup net) { if (powerReceiver.Provider is PowerProviderComponent && powerReceiver.Provider.ProviderOwner.TryGetComponent <NodeContainerComponent>(out var nodeContainer)) { var nodes = nodeContainer.Nodes; for (var index = 0; index < nodes.Count; index++) { if (nodes[index].NodeGroupID == NodeGroupID.WireNet) { net = nodes[index].NodeGroup; return(true); } } } net = default; return(false); }
public void AddDirtyNodeGroup(INodeGroup nodeGroup) { _dirtyNodeGroups.Add(nodeGroup); }
public void CombineGroup(INodeGroup newGroup) { }
protected virtual void OnGivingNodesForCombine(INodeGroup newGroup) { }