import { _decorator, Component, Node } from 'cc';
import { LevelManager } from '../global/data-flow/LevelManager';
import { GameManager } from '../global/state/GameManager';
import { UIManager } from '../global/ui/UIManager';
import { MainManager } from '../global/data-flow/MainManager';
import { GameSettingsManager } from '../global/data-flow/settings/GameSettingsManager';
import { UserDataBehaviour } from '../data/UserDataBehaviour';
import { TopLevelManager } from '../global/data-flow/TopLevelManager';
import { SoundManager } from '../global/Sound/SoundManager';
const { ccclass, property } = _decorator;

@ccclass('BootLoader')
export class BootLoader extends Component 
{
    @property({type: UserDataBehaviour})
    private userDataBehaviour: UserDataBehaviour;

    @property({type: SoundManager})
    private soundManager: SoundManager;

    @property({type: LevelManager})
    private levelManager: LevelManager;

    @property({type: GameManager})
    private gameManager: GameManager;

    @property({type: [TopLevelManager]})
    private managers: TopLevelManager[] = [];

    @property({type: MainManager})
    private mainManager: MainManager;

    protected start(): void 
    {
        this.mainManager.InitManagers();
        
        this.userDataBehaviour.fn_Init();
        this.soundManager.fn_Init();
        this.gameManager.fn_InitManagers();
        this.levelManager.fn_InitData(this.userDataBehaviour);
        this.gameManager.fn_InitState();
    }
}

