public LinkedList <T> GetChunkAt(int x, int y) { ChunkAddress addr = new ChunkAddress() { X = x / ChunkSize, Y = y / ChunkSize }; return(Chunks.ContainsKey(addr) ? Chunks[addr] : null); }
public void InsertAt(T item, int x, int y) { ChunkAddress addr = new ChunkAddress() { X = x / ChunkSize, Y = y / ChunkSize }; if (!Chunks.ContainsKey(addr)) { Chunks.Add(addr, new LinkedList <T>()); } Chunks[addr].AddLast(item); }