40 lines
517 B
TypeScript
40 lines
517 B
TypeScript
|
|
export abstract class Game {
|
|
constructor() {
|
|
|
|
}
|
|
|
|
init() {
|
|
print("init");
|
|
}
|
|
|
|
update() {
|
|
print("update");
|
|
}
|
|
|
|
dispose() {
|
|
print("Disposed");
|
|
}
|
|
}
|
|
|
|
let GAME_MAIN:Game|null = null;
|
|
|
|
export const gameSetMain = (game:Game) => {
|
|
print("setting", game);
|
|
GAME_MAIN = game;
|
|
}
|
|
|
|
const init = () => {
|
|
if(!GAME_MAIN) return;
|
|
GAME_MAIN.init();
|
|
}
|
|
|
|
const update = () => {
|
|
if(!GAME_MAIN) return;
|
|
GAME_MAIN.update();
|
|
}
|
|
|
|
const dispose = () => {
|
|
if(!GAME_MAIN) return;
|
|
GAME_MAIN.dispose();
|
|
} |