Ejemplo n.º 1
0
        public static Household ReturnLotOwner(Lot lot)
        {
            Household lotOwner = null;

            if (lot != null)
            {
                List <Household> hList = new List <Household>(Sims3.Gameplay.Queries.GetObjects <Household>());

                Sims3.Gameplay.RealEstate.PropertyData pd = null;
                if (hList != null && hList.Count > 0)
                {
                    foreach (Household h in hList)
                    {
                        pd = h.RealEstateManager.FindProperty(lot);
                        if (pd != null && pd.Owner != null)
                        {
                            lotOwner = pd.Owner.OwningHousehold;
                            break;
                        }
                    }
                }
            }

            return(lotOwner);
        }
Ejemplo n.º 2
0
        public static Household ReturnLotOwner(Lot lot)
        {
            Household lotOwner = null;

            if (lot != null)
            {
                //Check first is the lot a rabbit hole lot.
                List <Theatre> rList       = new List <Theatre>(Sims3.Gameplay.Queries.GetObjects <Theatre>());
                Theatre        rhOnThisLot = null;
                foreach (Theatre r in rList)
                {
                    if (r.LotCurrent == lot)
                    {
                        rhOnThisLot = r;
                        break;
                    }
                }
                //Is there a rabbit hole on this lot
                if (rhOnThisLot != null)
                {
                    List <Household> hList = new List <Household>(Sims3.Gameplay.Queries.GetObjects <Household>());
                    Sims3.Gameplay.RealEstate.PropertyData pd = null;
                    if (hList != null && hList.Count > 0)
                    {
                        foreach (Household h in hList)
                        {
                            pd = h.RealEstateManager.FindProperty(rhOnThisLot);

                            if (pd != null && pd.Owner != null)
                            {
                                lotOwner = pd.Owner.OwningHousehold;
                                break;
                            }
                        }
                    }
                }

                //If the lot is not a RH lot, check for venues
                if (lotOwner == null)
                {
                    List <Household> hList = new List <Household>(Sims3.Gameplay.Queries.GetObjects <Household>());
                    Sims3.Gameplay.RealEstate.PropertyData pd = null;
                    if (hList != null && hList.Count > 0)
                    {
                        foreach (Household h in hList)
                        {
                            pd = h.RealEstateManager.FindProperty(lot);

                            if (pd != null && pd.Owner != null)
                            {
                                lotOwner = pd.Owner.OwningHousehold;
                                break;
                            }
                        }
                    }
                }
            }
            return(lotOwner);
        }