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:
parent
4f509da373
commit
4e9e426519
|
|
@ -3,7 +3,7 @@ import getEffects from "./effect.csv";
|
||||||
import getEncounters from "./encounter.csv";
|
import getEncounters from "./encounter.csv";
|
||||||
import getEnemies from "./enemy.csv";
|
import getEnemies from "./enemy.csv";
|
||||||
import getIntents from "./intent.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 { default as dialogues } from "./dialogues/dialogues.yarnproject";
|
||||||
export { addTriggers } from "./triggers";
|
export { addTriggers } from "./triggers";
|
||||||
|
|
||||||
|
|
@ -14,6 +14,6 @@ export const enemies = getEnemies();
|
||||||
export const intents = getIntents();
|
export const intents = getIntents();
|
||||||
export const items = getItems();
|
export const items = getItems();
|
||||||
|
|
||||||
export const startingItems = ["剑", "盾", "水袋", "绷带"].map((key) =>
|
export const startingItems: Item[] = (
|
||||||
items.find((item) => item.name === key),
|
["剑", "盾", "水袋", "绷带"] as string[]
|
||||||
);
|
).map((key) => items.find((item) => item.name === key) as Item);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue