feat: hide tanks from lost if placed

This commit is contained in:
tresabhi committed 2024-11-25 14:20:10 -06:00
1 parent 6ace0aa38a
commit 258279205d
4 files changed
+14 -3

No files matched your search

+5
View File
@@ -1,3 +1,4 @@
import { enableMapSet } from 'immer';
import { create } from 'zustand';
import { subscribeWithSelector } from 'zustand/middleware';
import { tierListRows } from '../components/TierList/Table/constants';
@@ -6,13 +7,17 @@ import { createContextualStore } from '../core/zustand/createContextualStore';
export interface TierList {
dragging: boolean;
tanks: number[][];
placedTanks: Set<number>;
}
enableMapSet();
export const TierList = createContextualStore(() =>
create<TierList>()(
subscribeWithSelector<TierList>(() => ({
dragging: false,
tanks: tierListRows.map(() => []),
placedTanks: new Set(),
})),
),
);