public ChunkCache(short x1, short y1, short x2, short y2, Logger logger) { interactiveMode = false; this.logger = logger; logger.LogTechState("Calculating list of chunks..."); PixelMap.ConvertToRelative(x1, out byte chunkX1, out _); PixelMap.ConvertToRelative(y1, out byte chunkY1, out _); PixelMap.ConvertToRelative(x2, out byte chunkX2, out _); PixelMap.ConvertToRelative(y2, out byte chunkY2, out _); chunks = new List <XY>(); for (ushort x = chunkX1; x <= chunkX2; x++) { for (ushort y = chunkY1; y <= chunkY2; y++) { chunks.Add(((byte)x, (byte)y)); } } logger.LogTechInfo("Chunk list is calculated"); }