feat(samples): add Item type to desert data

Export the Item type from item.csv and add explicit typing to
startingItems in the desert sample data.
This commit is contained in:
hypercross 2026-04-19 14:47:58 +08:00
parent 4f509da373
commit 4e9e426519
1 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@ import getEffects from "./effect.csv";
import getEncounters from "./encounter.csv";
import getEnemies from "./enemy.csv";
import getIntents from "./intent.csv";
import getItems from "./item.csv";
import getItems, { Item } from "./item.csv";
export { default as dialogues } from "./dialogues/dialogues.yarnproject";
export { addTriggers } from "./triggers";
@ -14,6 +14,6 @@ export const enemies = getEnemies();
export const intents = getIntents();
export const items = getItems();
export const startingItems = ["剑", "盾", "水袋", "绷带"].map((key) =>
items.find((item) => item.name === key),
);
export const startingItems: Item[] = (
["剑", "盾", "水袋", "绷带"] as string[]
).map((key) => items.find((item) => item.name === key) as Item);