// index.tsx
import 'antd/dist/reset.css'; // AntD 5.x 建議用 reset.css
import { createRoot } from 'react-dom/client';
import App from './App.tsx';
import './Engine/CatanEngine/CSharp/String.ts';
import { BaseEnumerator } from './Engine/CatanEngine/CoroutineV2/Core/BaseEnumerator.ts';
import "./Engine/CatanEngine/Utils/CCExtensions/ArrayExtension.ts";
import "./Engine/CatanEngine/Utils/CCExtensions/NumberExtension.ts";
import './index.css';
import './utils/catan.ts';

// Router 與全局容器

async function onLoad(): Promise<void> {
	BaseEnumerator.Init();
	while (!BaseEnumerator.isInit) {
		await sleep(100);
	}

	createRoot(document.getElementById('root')!).render(<App />);
}

function sleep(ms: number): Promise<void> {
	return new Promise((resolve) => setTimeout(resolve, ms));
}

onLoad();
