/// <summary> /// Creates a special with the given parameters. /// </summary> /// <param name="name">The name of the item.</param> /// <param name="type">The type of the discount (flat, percentage, or dollar amount)</param> /// <param name="discount">the value of the special</param> /// <param name="applyCount">How many items are needed to fire this special</param> /// <param name="applyTo">How many items this special can be applied to</param> /// <param name="applyLimit">How many times this special can fire. Defaults to infinite.</param> public SpecialNormal(string name, int discount, DISCOUNT_TYPE type, int applyCount, int applyTo, int applyLimit = -1) { itemAffected = name; discount_type = type; itemCostChange = discount; itemsNeededToFire = applyCount; itemsApplied = applyTo; specialApplyLimit = applyLimit; if (discount_type == DISCOUNT_TYPE.SET_TO_AMOUNT) { CalculateFlatPrice(); } }
/// <summary> /// Creates a new special of the deferred type. /// note that they will only ever be toggled on a 1:1 basis. /// That is, one trigger item = one discounted item. /// </summary> /// <param name="name">The name of the affected item.</param> /// <param name="dt">The type of the discount (flat, by percentage, or by dollar amount)</param> /// <param name="discount">The value of the discount.</param> /// <param name="limit">How many times this discount can fire per person (default to infinite).</param> public SpecialDeferred(string name, int discount, DISCOUNT_TYPE dt, int limit = -1) { itemAffected = name; itemCostChange = discount; itemsNeededToFire = 1; itemsApplied = 1; specialApplyLimit = limit; special_type = SPECIAL_TT.DEFERRED; discount_type = dt; if (discount_type == DISCOUNT_TYPE.SET_TO_AMOUNT) { CalculateFlatPrice(); } }