初始仓库迁移
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-04 23:57:06 +08:00
parent 80986b790d
commit c49c64896a
18446 changed files with 532435 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
import type { GameState } from '../../types';
import type { CommitGeneratedState } from '../generatedState';
import { useEquipmentFlow } from '../useEquipmentFlow';
import { useForgeFlow } from '../useForgeFlow';
import { useInventoryFlow } from '../useInventoryFlow';
import type { InventoryFlowUi } from './uiTypes';
type TickCooldowns = (cooldowns: Record<string, number>) => Record<string, number>;
export function useStoryInventoryActions({
gameState,
commitGeneratedState,
tickCooldowns,
}: {
gameState: GameState;
commitGeneratedState: CommitGeneratedState;
tickCooldowns: TickCooldowns;
}) {
const inventoryFlow = useInventoryFlow({
gameState,
commitGeneratedState,
tickCooldowns,
});
const equipmentFlow = useEquipmentFlow({
gameState,
commitGeneratedState,
});
const forgeFlow = useForgeFlow({
gameState,
commitGeneratedState,
});
return {
inventoryUi: {
useInventoryItem: inventoryFlow.handleUseInventoryItem,
equipInventoryItem: equipmentFlow.handleEquipInventoryItem,
unequipItem: equipmentFlow.handleUnequipItem,
forgeRecipes: forgeFlow.forgeRecipes,
craftRecipe: forgeFlow.handleCraftRecipe,
dismantleItem: forgeFlow.handleDismantleItem,
reforgeItem: forgeFlow.handleReforgeItem,
} satisfies InventoryFlowUi,
};
}