Beispiel #1
0
        public static string GetDetails(Lot lot, Household me)
        {
            string msg = null;

            if (me != null)
            {
                msg += Common.Localize("StatusHouse:HouseName", false, new object[] { me.Name });
            }

            if (lot != null)
            {
                msg += Common.Localize("StatusHouse:LotName", false, new object[] { lot.Name });
            }

            if (me != null)
            {
                msg += Common.Localize("StatusHouse:Funds", false, new object[] { me.FamilyFunds });

                if (me.RealEstateManager != null)
                {
                    int realEstate = 0;
                    foreach (PropertyData data in me.RealEstateManager.AllProperties)
                    {
                        realEstate += data.TotalValue;
                    }

                    msg += Common.Localize("StatusHouse:RealEstate", false, new object[] { realEstate });
                }


                if (lot != null)
                {
                    int taxes, savings, vacationHome;
                    GetTaxes(me, out taxes, out savings, out vacationHome);
                    msg += Common.Localize("StatusHouse:Taxes", false, new object[] { (taxes - vacationHome) + savings, vacationHome, savings, taxes });
                }
            }

            if (lot == null)
            {
                msg += Common.Localize("StatusHouse:Homeless");
            }
            else
            {
                msg += Common.Localize("StatusHouse:Address", false, new object[] { lot.Address, Lots.GetUnfurnishedCost(lot), lot.Cost - lot.GetUnfurnishedCost(), lot.Cost });

                int iFridges = 0, iCribs = 0, iSingleBeds = 0, iDoubleBeds = 0;

                List <IGameObject> lotObjects = new List <IGameObject>(lot.GetObjects <IGameObject>());
                foreach (IGameObject obj in lotObjects)
                {
                    if (obj is Sims3.Gameplay.Objects.Appliances.Fridge)
                    {
                        iFridges++;
                    }
                    else if (obj is ICrib)
                    {
                        iCribs++;
                    }
                    else if (obj is IBedDouble)
                    {
                        iDoubleBeds++;
                    }
                    else if (obj is IBedSingle)
                    {
                        iSingleBeds++;
                    }
                }

                msg += Common.Localize("StatusHouse:Objects", false, new object[] { iFridges, iCribs, iDoubleBeds, iSingleBeds });
            }

            if ((me != null) && (!SimTypes.IsService(me)))
            {
                int    count     = 0;
                string occupants = null;

                foreach (SimDescription sim in CommonSpace.Helpers.Households.All(me))
                {
                    occupants += Common.NewLine + sim.FullName;

                    count++;
                    if (count >= 24)
                    {
                        break;
                    }
                }

                msg += Common.Localize("StatusHouse:Occupants", false, new object[] { occupants });
            }

            return(msg);
        }