//import * as PIXI from "pixi.js";
import {Logger, logSetup} from "./logger";
import {gateway_connect, GatewayClient} from "./gateway";
logSetup();
const logger = new Logger("client");
export interface GlobalData {
client: GatewayClient | null
}
export const global: GlobalData = {
client: null
}
async function client_main(server: string, username: string) {
logger.info("StarKingdoms client - starting");
global.client = await gateway_connect(server, username);
}
client_main("ws://localhost:3000/ws", "core").then(() => {});
/*
let app = new PIXI.Application({width: window.innerWidth, height: window.innerHeight, resizeTo: window });
// @ts-ignore
document.body.appendChild(app.view);
let sprite = PIXI.Sprite.from("./hearty.png");
app.stage.addChild(sprite);
let elapsed = 0.0;
app.ticker.add((delta) => {
elapsed += delta;
sprite.x = 100.0 + Math.cos(elapsed/50.0) * 100.0;
});
*/