public void setTileNChunk(Tile tile) { Chunk chk; if (!TryGetChunkAt(Chunk.toChunkPosition(tile.Pos), out chk)) { chk = new Chunk(Chunk.toChunkPosition(tile.Pos)); add(chk); } chk.set(tile); }
public void addTilenChunk(Tile t) { Chunk chk = getChunkAt(Chunk.toChunkPosition(t.Pos)); chk.add(t); }
public bool TryGetTileAt(int x, int y, out Tile tile) { Chunk chk; if (!TryGetChunkAt(Chunk.toChunkCoordinate(x), Chunk.toChunkCoordinate(y), out chk)) { tile = null; return false; } return chk.TryGetTileAt(Chunk.toChunkRelativeCoordinate(x), Chunk.toChunkRelativeCoordinate(y), out tile); }