This commit is contained in:
Hri7566 2023-12-09 18:05:17 -05:00
parent c460167221
commit 35ba9ea0cc
2 changed files with 34 additions and 0 deletions

View File

@ -6,3 +6,22 @@ export interface Item {
export interface StackableItem extends Item { export interface StackableItem extends Item {
count: number; count: number;
} }
export interface ConsumableItem extends Item {
consumable: true;
}
export interface FoodItem extends ConsumableItem {
edible: true;
}
export interface CakeItem extends FoodItem {
emoji: string;
icing: string;
filling: string;
}
export interface ShopItem extends Item {
buyValue: number;
sellValue: number;
}

15
src/economy/items.ts Normal file
View File

@ -0,0 +1,15 @@
import { Item } from "./Item";
const items = new Map<string, Item>();
export function getItem(key: string) {
return items.get(key);
}
export function setItem(key: string, item: Item) {
return items.set(key, item);
}
export function deleteItem(key: string) {
return items.delete(key);
}