예제 #1
0
 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);
 }
예제 #2
0
 public void addTilenChunk(Tile t)
 {
     Chunk chk = getChunkAt(Chunk.toChunkPosition(t.Pos));
     chk.add(t);
 }
예제 #3
0
 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);
 }