hypixel-auction-notifier/src/Item.ts

78 lines
1.2 KiB
TypeScript

// item.ts
export interface ItemData {
name: string;
id: string;
stars: number;
rarity: string;
recomb: boolean;
enchants: string[];
hpbs: number;
fpbs: number;
gemstones: string[];
aow: boolean;
lore: string;
}
export interface AuctionData {
auctionID: string;
category: string;
sales: number;
price: number;
profit: number;
percentProfit: number;
lbin: number;
ahType: string | null;
}
export class Item {
public itemData: ItemData;
public auctionData: AuctionData;
constructor(
name: string,
auctionID: string,
price: number,
rarity: string,
enchants: string[],
hpbs: number,
fpbs: number,
recomb: boolean,
artofwar: boolean,
stars: number,
gemstones: string[],
id: string,
category: string,
profit: number,
percentProfit: number,
lbin: number,
sales: number,
lore: string,
ahType: string | null = null
) {
this.itemData = {
name,
id,
stars,
rarity,
recomb,
enchants,
hpbs,
fpbs,
gemstones,
aow: artofwar,
lore,
};
this.auctionData = {
auctionID,
category,
sales,
price,
profit,
percentProfit,
lbin,
ahType,
};
}
}