UNPKG

bdo-shopping-cart-package

Version:
37 lines 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Action = exports.ActionTaken = void 0; var ShoppingCartProfitCalculator_1 = require("./../shoppingCart/ShoppingCartProfitCalculator"); var ActionTaken; (function (ActionTaken) { ActionTaken["Buy"] = "Buy"; ActionTaken["Craft"] = "Craft"; })(ActionTaken = exports.ActionTaken || (exports.ActionTaken = {})); var Action = /** @class */ (function () { /** * * @param monetaryCost Cost of individual item * @param time Time spent per item * @param recipe * @param recipe_id * @param actionSequence */ function Action(monetaryCost, time, recipe, recipe_id, actionSequence) { if (monetaryCost === void 0) { monetaryCost = 0; } if (time === void 0) { time = 0; } this.monetaryCost = monetaryCost; this.time = time; this.recipe = recipe; this.recipe_id = recipe_id || ''; this.actionSequence = actionSequence; } Action.prototype.calculateProfit = function (sellPrice) { return this.calculatePPS(sellPrice); }; Action.prototype.calculatePPS = function (sellPrice) { return ShoppingCartProfitCalculator_1.ProfitCalculator.calculateProfitPerSecond(sellPrice, this.monetaryCost, this.time); }; return Action; }()); exports.Action = Action; //# sourceMappingURL=Action.js.map