public static void UnSpoil(OFBStand stand) { foreach (var stack in stand.Inventory.InventoryItems.Values) { foreach (var item in stack.List) { if (item.Object.Value == 0) { ServingContainer single = item.Object as ServingContainer; ServingContainerGroup group = item.Object as ServingContainerGroup; int servingPrice = stand.info.ServingPrice; if (group != null) { group.mPurchasedPrice = ReturnPriceByQuality(single.FoodQuality, servingPrice * group.NumServingsLeft); group.RemoveSpoilageAlarm(); } else if (single != null) { single.mPurchasedPrice = ReturnPriceByQuality(single.FoodQuality, servingPrice); single.RemoveSpoilageAlarm(); } } } } }
public static void PayLotOwner(OFBStand stand, int price) { if (stand.info.Owner != null && price > 0) { stand.info.Owner.Household.SetFamilyFunds(stand.info.Owner.Household.FamilyFunds + price); } }
public static void PayEmployee(OFBStand stand, Sim sim, float hours) { int wage = (int)(hours * stand.info.PayPerHour); //Don't pay if townie if (!sim.SimDescription.IsTownie) sim.Household.SetFamilyFunds(sim.Household.FamilyFunds + wage); //Reduce funds from owner if (stand.info.Owner != null && stand.info.PayWageFromOwnersFunds) stand.info.Owner.Household.SetFamilyFunds(stand.info.Owner.Household.FamilyFunds - wage); }
public static void PayEmployee(OFBStand stand, Sim sim, float hours) { int wage = (int)(hours * stand.info.PayPerHour); //Don't pay if townie if (!sim.SimDescription.IsTownie) { sim.Household.SetFamilyFunds(sim.Household.FamilyFunds + wage); } //Reduce funds from owner if (stand.info.Owner != null && stand.info.PayWageFromOwnersFunds) { stand.info.Owner.Household.SetFamilyFunds(stand.info.Owner.Household.FamilyFunds - wage); } }