Пример #1
0
        protected override OptionResult Run(Lot lot, Household me)
        {
            int maxSelection = GetSpace(me);

            if (maxSelection <= 0)
            {
                SimpleMessageDialog.Show(Name, Common.Localize("AddSimHouse:TooMany"));
                return(OptionResult.Failure);
            }

            SimDescription targetSim = mActor.SimDescription;

            if (mTarget is Sim)
            {
                targetSim = (mTarget as Sim).SimDescription;
            }
            else if ((me != null) && (CommonSpace.Helpers.Households.NumSims(me) > 0))
            {
                if (Sim.ActiveActor != null)
                {
                    targetSim = Sim.ActiveActor.SimDescription;
                }
                else
                {
                    targetSim = me.AllSimDescriptions[0];
                }
            }

            bool okayed = false;
            List <IMiniSimDescription> sims = new Sims.MoveIn(me).GetSelection(targetSim, Name, SelectionOption.List, maxSelection, CanApplyAll(), out okayed);

            if ((sims == null) || (sims.Count == 0))
            {
                if (okayed)
                {
                    return(OptionResult.SuccessClose);
                }
                else
                {
                    return(OptionResult.Failure);
                }
            }

            return(PrivatePerform(lot, me, sims));
        }
Пример #2
0
        protected override OptionResult Run(Lot lot, Household me)
        {
            int maxSelection = GetSpace(me);
            if (maxSelection <= 0)
            {
                SimpleMessageDialog.Show(Name, Common.Localize("AddSimHouse:TooMany"));
                return OptionResult.Failure;
            }

            SimDescription targetSim = mActor.SimDescription;
            if (mTarget is Sim)
            {
                targetSim = (mTarget as Sim).SimDescription;
            }
            else if ((me != null) && (CommonSpace.Helpers.Households.NumSims(me) > 0))
            {
                if (Sim.ActiveActor != null)
                {
                    targetSim = Sim.ActiveActor.SimDescription;
                }
                else
                {
                    targetSim = me.AllSimDescriptions[0];
                }
            }

            bool okayed = false;
            List<IMiniSimDescription> sims = new Sims.MoveIn(me).GetSelection(targetSim, Name, SelectionOption.List, maxSelection, CanApplyAll(), out okayed);
            if ((sims == null) || (sims.Count == 0))
            {
                if (okayed)
                {
                    return OptionResult.SuccessClose;
                }
                else
                {
                    return OptionResult.Failure;
                }
            }

            return PrivatePerform(lot, me, sims);
        }