package com.mygdx.game.Dimension;

import com.mygdx.game.Character.Player;

import static com.mygdx.game.Restrictions.*;

public class World {
    public static void generateWorld(int x, int y) {
        Chunks chunks = new Chunks();
        if(chunks.isEmpty(x,y)){
            chunks.generateChunk(x, y);
        }
    }

    public static void loadChunks() {
        for (int i = -(RENDER_DISTANCE); i < RENDER_DISTANCE; i++) {
            for (int j = -(RENDER_DISTANCE); j < RENDER_DISTANCE; j++) {
                generateWorld(
                        i + Player.getX() / (TILE_SIZE * SUPER_CHUNK_SIZE * CHUNK_SIZE),
                        j + Player.getY() / (TILE_SIZE * SUPER_CHUNK_SIZE * CHUNK_SIZE)
                );
            }
        }
    }
}

