PEQNQJYNX7QOEM67QH2UF7VZ43AXHUBO76DN77L43MEFRHVDBO5QC
3UFL673QX2JG7KHTAM7DFH4BBYVHDNMXBS2RW45G3JBNFZFLSRRQC
WPC667PRTGRE7BNP6E7ZCQIKXYMIHJT3LUTTQT7VX2HQVRBXNIKAC
FLGWAOMMMGBO5ICWD3SXBOGJQA6LL2ZHTIQIMGY5VNFAETKDPPYAC
HXHNGFB2VCXB6YXDND35HJI22GBJC3QTSUR2TK3M3LXGJHVNXVHAC
DPJCZOPIKAKQIS4YRXETBSJA5ZTL2KQESSJE2TEZFLRQARXUVFXQC
B4JS4Z3VVAD5RJJ272S7GJM5BUNIHHMGNK2VSKVGZFPOVFP2YO4QC
Y7VEWZEPUKX2WWPTQCUSIF7YMRUC6JZQNUU5OX3HQDB4GSDSTQZAC
DFFMZSJOCLTBA3IGRYS2ZIJNO2MC3VLBBU42QL5DFY2SMCNFXPIAC
TQ57VE45BHV7MOZ6GKTYZEAMAOTXLPQ3ROCWJ2FUCITQWOYVMUIAC
FEYZALRNZQFN7QWCJGGTHHAYUN2OSSWD7SITQMOZIGQFUMWRFFCQC
QUT2VGNOS2XSDLSYCSMILCKF343M56MRPRSUWN4GXWPGCK6APK2QC
WO2ALETBVNH7N3NXJ6JKWCQ2YIZN6LBO7WEXPHAT3EQQJEUCJITQC
DHO4JCJIELKX4R42XXAMAHVQTTE6OWULLP2QF4BXO3UWC5UTMSMAC
TQAGEMW7FKIQCPQOJN44XVUZJQFQYNGSYRVIYSXFYF36HU7YDMZQC
export const UseGameStateContext = React.createContext<[DeepReadonly<GameState>, UpdaterGeneratorType<GameState>, () => void]>([] as any);
export const UseGameStateContext = React.createContext<[DeepReadonly<GameState>, UpdaterGeneratorType2<GameState>, () => void]>([] as any);
// // this.fpsTracker = new FpsTracker();
// // this.app.ticker.add((delta) => {
// // // delta should be approximately equal to 1
// // this.fpsTracker.tick(delta);
// // })
// let textFpsHud = new Pixi.Text('', {
// fontFamily: 'PixelMix',
// fontSize: 12,
// // align: 'right'
// });
// this.app.ticker.add(() => {
// textFpsHud.text = this.fpsTracker.getFpsString() + " FPS\n" + this.fpsTracker.getUpsString() + " UPS\n" +
// this.app.screen.width + "x" + this.app.screen.height;
// })
// textFpsHud.x = this.app.screen.width;
// this.onResize.push(() => { textFpsHud.x = this.app.screen.width; });
// textFpsHud.anchor.x = 1; // right justify
const childProps = {
delta: 0,
args: {
pointNodeTexture: this.state.pointNodeTexture.get(),
z: 0,
},
updaters: props.updaters,
position: props.appSize.multiply(0.5),
zLevelGen: new ZLevelGenFactory({}).create({ seed: props.gameState.worldGen.seed, z: 0 }),
selectedPointNode: props.gameState.playerUI.selectedPointNode,
allocatedPointNodeSubset: props.gameState.playerSave.allocatedPointNodeSet,
};
this.zLevel = new ZLevelComponent(childProps);
this.actionStage.addChild(this.zLevel.container);
if (props.gameState.worldGen.zLevels[0]) {
const childProps = {
delta: 0,
args: {
pointNodeTexture: this.state.pointNodeTexture.get(),
z: 0,
},
updaters: props.updaters,
position: props.appSize.multiply(0.5),
zLevelGen: props.gameState.worldGen.zLevels[0],
selectedPointNode: props.gameState.playerUI.selectedPointNode,
allocatedPointNodeSubset: props.gameState.playerSave.allocatedPointNodeSet,
};
if (!this.zLevel) {
this.zLevel = new ZLevelComponent(childProps);
this.actionStage.addChild(this.zLevel.container);
} else {
this.zLevel.update(childProps);
}
}
didMount(props: RootApplicationProps) {
didMount() {
const { args, updaters } = this.staleProps;
updaters.worldGen.zLevels.update((prev, prevGameState) => {
if (!prev[0]) {
return [new ZLevelGenFactory({}).create({ seed: prevGameState.worldGen.seed, z: 0 })];
}
return prev;
})