예제 #1
0
 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;
     }
 }
예제 #3
0
 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);
 }
예제 #5
0
 public void AddDirtyNodeGroup(INodeGroup nodeGroup)
 {
     _dirtyNodeGroups.Add(nodeGroup);
 }
예제 #6
0
 public void CombineGroup(INodeGroup newGroup)
 {
 }
예제 #7
0
 protected virtual void OnGivingNodesForCombine(INodeGroup newGroup)
 {
 }