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3UWC5UTMSMAC
CZPLX4O4R7K3TF3NSAL5PT7NO3CUOLDY3OR332GBIYYNKMZTW24AC
3J7QNHQ4F2VBYCK6SWKPO3AW3YYAJZNWOW6XNSURSRDZOE2ZIGQAC
R5HN6TNA5PO3DSVZ3ALMMBEO4HREQUTKIJJ7VEISOTRSFRBEDKYAC
WPC667PRTGRE7BNP6E7ZCQIKXYMIHJT3LUTTQT7VX2HQVRBXNIKAC
2OZGXOFLTXALS34QEIQ2F6VT7AUWYK7FVXUUDX66GZT5I7FUNPVAC
SACCO45GNBBHHTWCVMKJ64ZLGW32DM4DIKSOJF3N6U47WP4JY5HAC
if ((this._children as any[]).indexOf(childInstance) === -1) {
throw new Error(`Error, child ${childInstance} not found in ${this}`);
} else {
this.forceUpdates.push(this._children[(this._children as any[]).indexOf(childInstance)])
for (let childInfo of this._children) {
if (childInfo.instance === childInstance) { // we found the instance in our _children array, now ensure it is in force updates array then return
if (this.forceUpdates.indexOf(childInfo) === -1) {
this.forceUpdates.push(childInfo);
}
return;
}
let childProps = {
delta: props.delta,
args: {
pointNodeTexture: props.args.pointNodeTexture,
markForceUpdate: this.markForceUpdate,
},
selfPointNodeRef: pointNodeRef,
updaters: props.updaters,
position: pointNodeRef.pointNodeCoord.multiply(RenderedChunkConstants.SPACING_PX),
pointNodeGen,
isSelected: props.selectedPointNode?.pointNodeId === pointNodeRef.pointNodeId,
isAllocated: props.allocatedPointNodeSubset.contains(pointNodeRef),
};
let childPropsFactory = (props: Props, state: State) => {
return {
delta: props.delta,
args: {
pointNodeTexture: props.args.pointNodeTexture,
markForceUpdate: this.markForceUpdate,
},
selfPointNodeRef: pointNodeRef,
updaters: props.updaters,
position: pointNodeRef.pointNodeCoord.multiply(RenderedChunkConstants.SPACING_PX),
pointNodeGen,
isSelected: props.selectedPointNode?.pointNodeId === pointNodeRef.pointNodeId,
isAllocated: props.allocatedPointNodeSubset.contains(pointNodeRef),
};
}
export type ChunkComponentProps = Props;
if ((this._children as any[]).indexOf(childInstance) === -1) {
throw new Error(`Error, child ${childInstance} not found in ${this}`);
} else if (this.forceUpdates.indexOf(childInstance) !== -1) {
// already added to forceUpdates array, we can skip
} else {
this.forceUpdates.push(this._children[(this._children as any[]).indexOf(childInstance)])
for (let childInfo of this._children) {
if (childInfo.instance === childInstance) { // we found the instance in our _children array, now ensure it is in force updates array then return
if (this.forceUpdates.indexOf(childInfo) === -1) {
this.forceUpdates.push(childInfo);
}
return;
}
if ((this._children as any[]).indexOf(childInstance) === -1) {
throw new Error(`Error, child ${childInstance} not found in ${this}`);
} else {
this.forceUpdates.push(this._children[(this._children as any[]).indexOf(childInstance)])
for (let childInfo of this._children) {
if (childInfo.instance === childInstance) { // we found the instance in our _children array, now ensure it is in force updates array then return
if (this.forceUpdates.indexOf(childInfo) === -1) {
this.forceUpdates.push(childInfo);
}
return;
}
let prevSize = prevProps.gameState.playerSave.allocatedPointNodeSet.size()
let nextSize = props.gameState.playerSave.allocatedPointNodeSet.size()
if (prevSize !== nextSize) { console.log('rootapp shouldUpdate', { prevSize, nextSize }); }
// let prevSize = prevProps.gameState.playerSave.allocatedPointNodeSet.size()
// let nextSize = props.gameState.playerSave.allocatedPointNodeSet.size()
// if (prevSize !== nextSize) { console.log('rootapp shouldUpdate', { prevSize, nextSize }); }
if ((this._children as any[]).indexOf(childInstance) === -1) {
throw new Error(`Error, child ${childInstance} not found in ${this}`);
} else {
this.forceUpdates.push(this._children[(this._children as any[]).indexOf(childInstance)])
for (let childInfo of this._children) {
if (childInfo.instance === childInstance) { // we found the instance in our _children array, now ensure it is in force updates array then return
if (this.forceUpdates.indexOf(childInfo) === -1) {
this.forceUpdates.push(childInfo);
}
return;
}
doChild(props: Props, chunkCoord: Vector2, chunkGen: ChunkGen): { childKey: ChunkRef, childProps: ChunkComponentProps } {
doChild(props: Props, chunkCoord: Vector2, chunkGen: ChunkGen): { childKey: ChunkRef, childPropsFactory: (p: Props, s: State) => ChunkComponentProps } {
let childProps = {
delta: props.delta,
args: {
pointNodeTexture: props.args.pointNodeTexture,
markForceUpdate: this.markForceUpdate
},
selfChunkRef: chunkRef,
updaters: props.updaters,
position: chunkRef.chunkCoord.multiply(RenderedChunkConstants.CHUNK_SPACING_PX),
chunkGen: chunkGen,
// NOTE(bowei): for optimization, we dont tell other chunks about selected nodes in other chunks
selectedPointNode: (props.selectedPointNode?.chunkCoord.equals(chunkRef.chunkCoord) ? props.selectedPointNode : undefined),
allocatedPointNodeSubset,
let childPropsFactory = (props: Props, state: State) => {
return {
delta: props.delta,
args: {
pointNodeTexture: props.args.pointNodeTexture,
markForceUpdate: this.markForceUpdate
},
selfChunkRef: chunkRef,
updaters: props.updaters,
position: chunkRef.chunkCoord.multiply(RenderedChunkConstants.CHUNK_SPACING_PX),
chunkGen: chunkGen,
// NOTE(bowei): for optimization, we dont tell other chunks about selected nodes in other chunks
selectedPointNode: (props.selectedPointNode?.chunkCoord.equals(chunkRef.chunkCoord) ? props.selectedPointNode : undefined),
allocatedPointNodeSubset,
};