public void AddConnectionOnGrid(Direction direction, Vector2 gridPos) { if (!ConnectedGridPositions.ContainsKey(direction)) { ConnectedGridPositions.Add(direction, gridPos); _directionFlag |= direction; UpdateWireType(); } }
public void RemoveConnection(Direction direction) { if (ConnectedGridPositions.ContainsKey(direction)) { var connection = GetConnection(direction); ConnectedGridPositions.Remove(direction); if (connection) { ClearBridges(Connections[direction]); } _directionFlag ^= direction; UpdateWireType(); UpdateConnections(); } }