public void AddConnection (Connection c) { Connection[] tmp = new Connection[connections.Length+1]; for (int i=0;i<connections.Length;i++) { tmp[i] = connections[i]; } tmp[connections.Length] = c; connections = tmp; GenerateEnabledConnections (); }
public void GenerateEnabledConnections () { Connection[] tmp = new Connection[connections.Length]; int c =0; for (int i=0;i<connections.Length;i++) { if (connections[i].enabled) { tmp[c] = connections[i]; c++; } } enabledConnections = new Connection[c]; for (int i=0;i<c;i++) { enabledConnections[i] = tmp[i]; } }