Example #1
0
        public static void ReimburseDeeds(RealEstateManager newOwner, RabbitHole rabbitHole)
        {
            foreach (Household house in Household.GetHouseholdsLivingInWorld())
            {
                if (house.RealEstateManager == null)
                {
                    continue;
                }

                if (house.RealEstateManager == newOwner)
                {
                    continue;
                }

                PropertyData data = house.RealEstateManager.FindProperty(rabbitHole);
                if (data == null)
                {
                    continue;
                }

                int totaValue = data.TotalValue;

                using (ManagerMoney.SetAccountingKey setKey = new ManagerMoney.SetAccountingKey(house, "PropertySold"))
                {
                    house.RealEstateManager.SellProperty(data, true);
                }

                if (house != Household.ActiveHousehold)
                {
                    Common.Notify(Common.Localize("Deeds:Reimbursement", false, new object[] { house.Name, totaValue }));
                }
            }
        }
Example #2
0
 public static int Perform(Sim sim)
 {
     using (ManagerMoney.SetAccountingKey setKey = new ManagerMoney.SetAccountingKey(sim.Household, "Investments"))
     {
         return(Investments.Collect(sim));
     }
 }
Example #3
0
        public override bool Run()
        {
            try
            {
                RabbitHole target = null;

                foreach (RabbitHole hole in Sims3.Gameplay.Queries.GetObjects <RabbitHole>())
                {
                    if (hole.Guid == RabbitHoleType.CityHall)
                    {
                        target = hole;
                        break;
                    }
                }

                ReimburseDeeds(Actor.Household.RealEstateManager, Target);

                if (target != null)
                {
                    RabbitHole.PurchaseVenue.Definition definition = new RabbitHole.PurchaseVenue.Definition(Target);
                    return(Actor.InteractionQueue.PushAsContinuation(definition.CreateInstance(target, Actor, GetPriority(), Autonomous, true), false));
                }

                StandardEntry();
                BeginCommodityUpdates();

                bool flag = false;
                try
                {
                    using (ManagerMoney.SetAccountingKey setKey = new ManagerMoney.SetAccountingKey(Actor.Household, "PropertyBought"))
                    {
                        if (Target.IsCommunityLot)
                        {
                            flag = Actor.Household.RealEstateManager.PurchaseVenue(Target) != null;
                        }
                        else
                        {
                            flag = Actor.Household.RealEstateManager.PurchasePrivateLot(Target) != null;
                        }
                    }
                }
                finally
                {
                    EndCommodityUpdates(true);
                    StandardExit();
                }
                return(flag);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Example #4
0
        public static void ReimburseDeeds(RealEstateManager newOwner, Lot lot)
        {
            foreach (Household house in Household.GetHouseholdsLivingInWorld())
            {
                if (house.RealEstateManager == null) continue;

                if (house.RealEstateManager == newOwner) continue;

                PropertyData data = house.RealEstateManager.FindProperty(lot);
                if (data == null) continue;

                int totaValue = data.TotalValue;

                using (ManagerMoney.SetAccountingKey setKey = new ManagerMoney.SetAccountingKey(house, "PropertySold"))
                {
                    house.RealEstateManager.SellProperty(data, true);
                }

                if (house != Household.ActiveHousehold)
                {
                    Common.Notify(Common.Localize("Deeds:Reimbursement", false, new object[] { house.Name, totaValue }));
                }
            }
        }
Example #5
0
        public override bool Run()
        {
            try
            {
                RabbitHole target = null;

                foreach (RabbitHole hole in Sims3.Gameplay.Queries.GetObjects<RabbitHole>())
                {
                    if (hole.Guid == RabbitHoleType.CityHall)
                    {
                        target = hole;
                        break;
                    }
                }

                ReimburseDeeds(Actor.Household.RealEstateManager, Target);

                if (target != null)
                {
                    RabbitHole.PurchaseVenue.Definition definition = new RabbitHole.PurchaseVenue.Definition(Target);
                    return Actor.InteractionQueue.PushAsContinuation(definition.CreateInstance(target, Actor, GetPriority(), Autonomous, true), false);
                }

                StandardEntry();
                BeginCommodityUpdates();

                bool flag = false;
                try
                {
                    using (ManagerMoney.SetAccountingKey setKey = new ManagerMoney.SetAccountingKey(Actor.Household, "PropertyBought"))
                    {
                        if (Target.IsCommunityLot)
                        {
                            flag = Actor.Household.RealEstateManager.PurchaseVenue(Target) != null;
                        }
                        else
                        {
                            flag = Actor.Household.RealEstateManager.PurchasePrivateLot(Target) != null;
                        }
                    }
                }
                finally
                {
                    EndCommodityUpdates(true);
                    StandardExit();
                }
                return flag;
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return false;
            }
        }