Esempio n. 1
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!ApplyAll)
            {
                List<IApplyOptionItem> services = new List<IApplyOptionItem>();

                foreach (ServiceType type in Enum.GetValues(typeof(ServiceType)))
                {
                    int count = 0;

                    bool found = false;

                    foreach (Service service in Services.AllServices)
                    {
                        if (service.ServiceType == type)
                        {
                            count = service.mPool.Count;

                            found = true;
                            break;
                        }
                    }

                    if (!found) continue;

                    services.Add(new StatusServiceType.Item(type, count));
                }

                foreach(PetPoolType type in Enum.GetValues(typeof(PetPoolType)))
                {
                    if (PetPoolManager.IsPoolFull(type)) continue;

                    int count = PetPoolManager.GetPoolSize(type);                    

                    services.Add(new StatusPetPool.Item(type, count));
                }

                if (GameUtils.IsInstalled(ProductVersion.EP10))
                {
                    services.Add(new MermaidServiceItem(CommonSpace.Helpers.Households.NumSims(Household.MermaidHousehold)));
                }

                IApplyOptionItem selection = new CommonSelection<IApplyOptionItem>(Name, me.FullName, services).SelectSingle();
                if (selection == null) return false;

                mPool = selection;
            }

            List<IMiniSimDescription> list = new List<IMiniSimDescription>();
            list.Add(me);

            if (!AddSim.TestForRemainingActive(list))
            {
                Common.Notify(Common.Localize("AddSim:ActiveFail"));
                return false;
            }

            mPool.Apply(me);
            return true;
        }
Esempio n. 2
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!ApplyAll)
            {
                List <IApplyOptionItem> services = new List <IApplyOptionItem>();

                foreach (ServiceType type in Enum.GetValues(typeof(ServiceType)))
                {
                    int count = 0;

                    bool found = false;

                    foreach (Service service in Services.AllServices)
                    {
                        if (service.ServiceType == type)
                        {
                            count = service.mPool.Count;

                            found = true;
                            break;
                        }
                    }

                    if (!found)
                    {
                        continue;
                    }

                    services.Add(new StatusServiceType.Item(type, count));
                }

                foreach (PetPoolType type in Enum.GetValues(typeof(PetPoolType)))
                {
                    if (PetPoolManager.IsPoolFull(type))
                    {
                        continue;
                    }

                    int count = PetPoolManager.GetPoolSize(type);

                    services.Add(new StatusPetPool.Item(type, count));
                }

                if (GameUtils.IsInstalled(ProductVersion.EP10))
                {
                    services.Add(new MermaidServiceItem(CommonSpace.Helpers.Households.NumSims(Household.MermaidHousehold)));
                }

                IApplyOptionItem selection = new CommonSelection <IApplyOptionItem>(Name, me.FullName, services).SelectSingle();
                if (selection == null)
                {
                    return(false);
                }

                mPool = selection;
            }

            List <IMiniSimDescription> list = new List <IMiniSimDescription>();

            list.Add(me);

            if (!AddSim.TestForRemainingActive(list))
            {
                Common.Notify(Common.Localize("AddSim:ActiveFail"));
                return(false);
            }

            mPool.Apply(me);
            return(true);
        }