예제 #1
0
        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();
                        }
                    }
                }
            }
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
        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();
                        }
                    }
                }

            }
        }
예제 #4
0
 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);
     }
 }
예제 #5
0
        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);

        }
예제 #6
0
        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);
            }
        }