* Add handleSetUpgrade function and other related stuff * Fix select drill to upgrade * Small refactor - apply drill on upgrade * Refactor types - WIP * Add handleBuy function, sort storeItems by owned * Add tiers to storeItems * Show equipment on moon, add radiobutton to select * Modify types * Cleanup some code and comments etc. * Add claim function to increment user balance and decrement well * Add API to get data * Set inventoryItem and activeTier in state * Update stakingSource whenever inventoryItems are updated * Disable upgrade button when mining is active * Add initial implementation of lightbox --------- Co-authored-by: Nico Li <nilindenau@gmail.com>
55 lines
928 B
TypeScript
55 lines
928 B
TypeScript
export type User = {
|
|
id: number;
|
|
inventoryItems: IInventoryItem[];
|
|
};
|
|
|
|
export interface IResourceType {
|
|
id: number;
|
|
name: string;
|
|
fontColorClass: string;
|
|
bgColorClass: string;
|
|
}
|
|
|
|
export interface IResourceWell {
|
|
id: number;
|
|
resourceType: IResourceType;
|
|
supply: number;
|
|
}
|
|
|
|
export interface IStakingSource {
|
|
id: number;
|
|
name: string;
|
|
description: string;
|
|
resourceWells: IResourceWell[];
|
|
inventoryItem: IInventoryItem | null;
|
|
}
|
|
|
|
export interface IInventoryItem {
|
|
id: number;
|
|
storeItem: IStoreItem;
|
|
currentTierIndex: number;
|
|
}
|
|
|
|
export interface IStoreItem {
|
|
id: number;
|
|
name: string;
|
|
description: string;
|
|
price: number;
|
|
timeToClaim: number;
|
|
tiers: {
|
|
tier: number;
|
|
price: number;
|
|
}[];
|
|
}
|
|
|
|
export interface IBankAccount {
|
|
id: number;
|
|
resourceType: IResourceType;
|
|
balance: number;
|
|
}
|
|
|
|
export interface IClaimableResource {
|
|
resourceType: IResourceType;
|
|
balance: number;
|
|
}
|