3J7QNHQ4F2VBYCK6SWKPO3AW3YYAJZNWOW6XNSURSRDZOE2ZIGQAC
ANA23YLFENNJU3UZDZKIKGZJLM46AM2LQEQ7SPRUVRMOQGDG4DFAC
DDJJXZKSQLXUXIMLKMKHY75JKC2IRA2A7SEVSUNL5FSCFH77T4IAC
WPC667PRTGRE7BNP6E7ZCQIKXYMIHJT3LUTTQT7VX2HQVRBXNIKAC
TQ57VE45BHV7MOZ6GKTYZEAMAOTXLPQ3ROCWJ2FUCITQWOYVMUIAC
3EAR4KTTJ26IRF5QUGEDRMJVBR4X3VWSQ6OBIJCLDH3A4ZZ4O3ZAC
CZPLX4O4R7K3TF3NSAL5PT7NO3CUOLDY3OR332GBIYYNKMZTW24AC
WO2ALETBVNH7N3NXJ6JKWCQ2YIZN6LBO7WEXPHAT3EQQJEUCJITQC
DHO4JCJIELKX4R42XXAMAHVQTTE6OWULLP2QF4BXO3UWC5UTMSMAC
V7PGPHZNTW5HIJQBIM3W57YPS4LYID54XHZZXPFM6BRHLC3Z2B6QC
3UFL673QX2JG7KHTAM7DFH4BBYVHDNMXBS2RW45G3JBNFZFLSRRQC
NKWFGTCM6HM35MAJAREANFQS76ALYOD7K6FT77X5HQPBCRAPXVRAC
Y7TNTUXM44MRLGA6FEG7J6BR77I7N3AIPZYVPXULOQZQ6PNOWJ7QC
updaters.playerSave.allocatedPointNodeSet.update((prev, prevGameState) => {
// if we were already selected, allocate us
if (prevGameState.playerUI.selectedPointNode?.pointNodeId === args.selfPointNodeRef.pointNodeId) {
prev.put(args.selfPointNodeRef);
return prev.clone();
}
return prev;
})
// if we were already selected, allocate us and add to the history (maybe this should be managed elsewhere??)
if (prevGameState.playerUI.selectedPointNode?.pointNodeId === args.selfPointNodeRef.pointNodeId) {
// if we were already selected, but not yet allocated, allocate us and add to the history (maybe this should be managed elsewhere??)
if (prevGameState.playerUI.selectedPointNode?.pointNodeId === args.selfPointNodeRef.pointNodeId &&
!prevGameState.playerSave.allocatedPointNodeSet.contains(args.selfPointNodeRef)
) {
updaters.playerSave.allocatedPointNodeSet.update((prev, prevGameState) => {
let history = prevGameState.playerSave.allocatedPointNodeHistory
let mostRecent = history[history.length - 1]
console.log({ history, actualHistory: [...history] });
// if we were already selected, try to allocate us
if (!prev.contains(mostRecent)) {
prev.put(mostRecent);
const next = prev.clone();
console.log({ prev, next, prevSize: prev.size(), nextSize: next.size(), isEqual: prev === next })
return next;
}
return prev;
})