mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: isolated duel
This commit is contained in:
1 parent
fce5f19100
commit
0b5c2e42fb
15 files changed
+218
-249
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { produce } from 'immer';
|
||||
import { create } from 'zustand';
|
||||
import { DuelMember } from './tankopedia';
|
||||
|
||||
export interface Duel {
|
||||
assigned: boolean;
|
||||
protagonist?: DuelMember;
|
||||
antagonist?: DuelMember;
|
||||
}
|
||||
|
||||
export const useDuel = create<Duel>()(() => ({
|
||||
assigned: false,
|
||||
}));
|
||||
|
||||
export function mutateDuel(recipe: (draft: Duel) => void) {
|
||||
useDuel.setState(produce(recipe));
|
||||
}
|
||||
Reference in new issue
Block a user