///// CONSTRUCTORS /// <summary> /// Create a new level of the given size that uses the given apetures. /// </summary> /// <param name="chunkBounds"></param> /// <param name="apeturesByPriority"></param> public Level(Coordinate chunkBounds, ChunkResolutionAperture[] apeturesByPriority) { seed = 1234; this.chunkBounds = chunkBounds; apertures = apeturesByPriority; if (apeturesByPriority != null && apeturesByPriority.Length == Enum.GetNames(typeof(AperturePriority)).Length) { for (AperturePriority priority = 0; (int)priority < apeturesByPriority.Length; priority++) { apertures[(int)priority].setLevel(this, priority); } } else if (apertures == null) { apertures = new ChunkResolutionAperture[0]; } }
/// <summary> /// Return the apeture for the resolution layer. /// </summary> /// <param name="resolutionLayer"></param> /// <returns></returns> public ChunkResolutionAperture getApetureByPriority(AperturePriority resolutionLayer) { return(apertures.Length > (int)resolutionLayer ? apertures[(int)resolutionLayer] : null); }