bdo-shopping-cart-package
Version:
For use with my bdo-crafting-profit projects
55 lines • 1.79 kB
TypeScript
import { Optimizer } from "../optimizers/OptimizerInterface";
import { Item } from "./ShoppingCartCore";
import { CartEntry } from "./CartEntry";
export interface ShoppingCartCalculation {
currentCart: Array<CartEntry>;
recipePrice: number;
cumulativeTimeSpent: number;
}
export declare class ShoppingCart {
cart: Array<CartEntry>;
optimizer: Optimizer;
/**
*
* @param optimizer Instance of PPSOptimizer
*/
constructor(optimizer: Optimizer);
clearCart(): void;
/**
*
* @param optimizer
*/
setOptimizer(optimizer: Optimizer): void;
/**
* Clears the cart and begins recursively adding items to the cart
* @param itemName
* @param quantity
* @param items
*/
calculateCosts(itemName: string, quantity: number | undefined, items: {
[key: string]: Item;
}): ShoppingCartCalculation;
/**
* Adds item to cart if it doesn't exist. Ues recursion to add ingredients as well.
* @param itemName
* @param quantity
* @param selectedRecipeId
* @param parentName
* @param items
* @param parentPath
*/
addItem(itemName: string, quantity: number | undefined, selectedRecipeId: string, parentName?: string, items?: {
[key: string]: Item;
}, parentPath?: string): ShoppingCartCalculation;
printShoppingCart(): void;
/**
* @deprecated
* @param item Object of type Item
* @param recipeId The recipe Id you want the price calculated for
* @param items All items (From ItemManager.parseRecipes())
*/
getPriceForRecipe(item: Item, recipeId: string, items: {
[key: string]: Item;
}): number;
}
//# sourceMappingURL=ShoppingCart.d.ts.map