import Alea from "alea";
import { Container } from "../../pixi/pixi.mjs";
import { GameScene } from "../GameScene/GameScene";
import { TerrainManger } from "../WorldGenV2/TerrainManager/TerrainManager";


export let BC_APP;
export function setBC_APP(app) {
    BC_APP = app;
};

/**
 * @type Container
 */
export let BC_VIEWPORT;
export function setBC_VIEWPORT(viewport) {
    BC_VIEWPORT = viewport;
};

/**
 * {PIXI.Container}
 */
export let BC_WORLD;
export function setBC_WORLD(world) {
    BC_WORLD = world;
};

/**
 * {PIXI.Container}
 */
export let BC_SELECTION;
export function setBC_SELECTION(selection) {
    BC_SELECTION = selection;
};

/**
 * {PIXI.Container}
 */
export let BC_NPC_LAYER;
export function setBC_NPC_LAYER(npc_layer) {
    BC_NPC_LAYER = npc_layer;
};

// export let BC_TERRAIN;
export let BC_TERRAIN_SETTINGS = {
    tileSize: 16,
    scale: 2,
    totalSize: 16*2
}
// export let BC_TERRAIN_VAULT = {};
// export function setBC_TERRAIN(terrain) {
//     BC_TERRAIN = terrain;
// };

// export let BC_VEGETATION;
// export let BC_VEGETATION_VAULT = {};
// export function setBC_VEGETATION(veg) {
//     BC_VEGETATION = veg;
// };

export let BC_SPRITES_SETTINGS = {
    defaultSize: 16,
    scale: 2
};

// export let BC_CHUNKS_VAULT = {};
export let BC_CHUNKS_SETTINGS = {
    width: 20, //tiles
    height: 20, //tiles
};

export const BC_CAMERA = {
    position: {x: 0.0, y: 0.0},
    offset_position: {x: 0.0, y: 0.0},
    zoom: 1.5,
    targetZoom: 1.5,
    minZoom: 1.2,
    maxZoom: 4,
    zoomStep: 0.1,
};

export let PRNG = new Alea();
export function setNewPRNG(prng) {
    PRNG = prng;
};

export const BC_BUILDING_PLACEHOLDERS = [];

/**
 * @type GameScene
 */
export let BC_CURRENT_SCENE;
/**
 * 
 * @param {GameScene} scene new scene
 */
export function setBC_CURRENT_SCENE(scene) {
    BC_CURRENT_SCENE = scene;
};

/**
 * @type {TerrainManger}
 */
export let BC_TERRAIN_MANAGER;

/**
 * 
 * @param {TerrainManger} manager 
 */
export function setBC_TERRAIN_MANAGER(manager) {
    BC_TERRAIN_MANAGER = manager;
}