• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Household类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Household的典型用法代码示例。如果您正苦于以下问题:C# Household类的具体用法?C# Household怎么用?C# Household使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Household类属于命名空间,在下文中一共展示了Household类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MemberListModel

 public MemberListModel(Household household, List<User> users, bool canEditPermissions, bool canEditUser)
 {
     Household = household;
     Users = users;
     CanEditPermissions = canEditPermissions;
     CanEditUser = canEditUser;
 }
开发者ID:SergeantJack,项目名称:Luna,代码行数:7,代码来源:MemberListModel.cs


示例2: Reset

        public override void Reset()
        {
            base.Reset();

            if (SimTypes.IsDead(Sim)) return;

            mHouse = Sim.Household;

            mNetWorth = 0;
            if (mHouse != null)
            {
                if (mHouse.LotHome != null)
                {
                    if (mHouse.LotHome != mLot)
                    {
                        mLot = mHouse.LotHome;

                        mLotHomeCost = StoryProgression.Main.Lots.GetLotCost(mLot);
                    }

                    mNetWorth = mHouse.FamilyFunds + mLotHomeCost;
                }
                else
                {
                    mNetWorth = mHouse.NetWorth();

                    mLot = null;
                    mLotHomeCost = 0;
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:31,代码来源:StoredNetWorkSimData.cs


示例3: Run

        protected override OptionResult Run(Lot lot, Household me)
        {
            if (me == null) return OptionResult.Failure;

            string text = StringInputDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":Prompt"), me.Name);
            if (string.IsNullOrEmpty(text)) return OptionResult.Failure;

            if (AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":SimsPrompt", false, new object[] { me.Name, text })))
            {
                foreach (SimDescription sim in CommonSpace.Helpers.Households.All(me))
                {
                    if (sim.LastName.Trim().ToLower() == me.Name.Trim().ToLower())
                    {
                        sim.LastName = text;

                        if (me == Household.ActiveHousehold)
                        {
                            HudModel hudModel = Sims3.UI.Responder.Instance.HudModel as HudModel;
                            if (sim.CreatedSim != null)
                            {
                                Household.AddDirtyNameSimID(sim.SimDescriptionId);
                                hudModel.NotifyNameChanged(sim.CreatedSim.ObjectId);
                            }
                        }
                    }
                }
            }

            me.Name = text;
            return OptionResult.SuccessClose;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:31,代码来源:ChangeName.cs


示例4: CloseHouse

        protected static void CloseHouse(Household house)
        {
            if (house != null)
            {
                if (house == Household.ActiveHousehold) return;

                Dictionary<Lot, bool> lots = new Dictionary<Lot, bool>();
                foreach (Sim sim in Households.AllSims(house))
                {
                    if (sim.LotCurrent == null) continue;

                    if (!lots.ContainsKey(sim.LotCurrent))
                    {
                        lots.Add(sim.LotCurrent, true);
                    }
                }

                foreach (Lot lot in LotManager.AllLots)
                {
                    if (lots.ContainsKey(lot)) continue;

                    if (lot.IsResidentialLot)
                    {
                        house.RemoveGreetedLotForHousehold(lot, ObjectGuid.InvalidObjectGuid);
                    }
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:28,代码来源:HomeOpener.cs


示例5: ShowSimSelector

        /// <summary>
        /// 
        /// </summary>
        /// <param name="interactionName"></param>
        /// <returns></returns>
        public static List<IMiniSimDescription> ShowSimSelector(Sim actor, Household currentHousehold, string interactionName)
        {
            List<IMiniSimDescription> residents = new List<IMiniSimDescription>();
            string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]);

            List<PhoneSimPicker.SimPickerInfo> list = new List<PhoneSimPicker.SimPickerInfo>();

            List<object> list2;

            //Create list of sims
            foreach (Sim s in currentHousehold.Sims)
            {
                list.Add(Phone.Call.CreateBasicPickerInfo(actor.SimDescription, s.SimDescription));
            }

            list2 = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, list, interactionName, interactionName, buttonFalse, currentHousehold.Sims.Count, false);

            if (list2 == null || list2.Count == 0)
            {
                return null;
            }
            foreach (var item in list2)
            {
                residents.Add(item as SimDescription);
            }

            return residents;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:33,代码来源:CommonMethods.cs


示例6: Perform

        public static string Perform(Household house, bool ignorePlaceholders)
        {
            if (house.LotHome == null) return null;

            string msg = null;

            if (Households.NumSims(house) != Households.AllSims(house).Count)
            {
                List<SimDescription> sims = new List<SimDescription>(Households.All(house));
                foreach (SimDescription description in sims)
                {
                    bool flag = true;
                    foreach (Sim sim in Households.AllSims(house))
                    {
                        if (sim.SimDescription == description)
                        {
                            flag = false;
                            break;
                        }
                    }

                    if (flag)
                    {
                        FixInvisibleTask.Perform(description, false);

                        msg += RecoverMissingSimTask.Perform(description, ignorePlaceholders);
                    }
                }
            }

            return msg;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:32,代码来源:RecoverMissingSims.cs


示例7: Run

        protected override OptionResult Run(Lot lot, Household me)
        {
            if (lot != null)
            {
                List<Item> allOptions = new List<Item>();

                foreach (Household house in Household.sHouseholdList)
                {
                    if (house.RealEstateManager == null) continue;

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

                    allOptions.Add(new Item(house, lot, RealEstate.OwnerType.Full, data.TotalValue));
                }

                if (allOptions.Count == 0)
                {
                    SimpleMessageDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":Failure"));
                    return OptionResult.Failure;
                }

                CommonSelection<Item>.Results choices = new CommonSelection<Item>(Name, allOptions).SelectMultiple();
                if ((choices == null) || (choices.Count == 0)) return OptionResult.Failure;

                foreach (Item item in choices)
                {
                    item.Perform();
                }
            }

            return OptionResult.SuccessClose;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:33,代码来源:VenueOwnership.cs


示例8: OnWorldLoadFinished

        public void OnWorldLoadFinished()
        {
            new Common.DelayedEventListener(EventTypeId.kSocialInteraction, OnSocialEvent);
            new Common.DelayedEventListener(EventTypeId.kHouseholdSelected, OnHouseSelected);

            sOldHousehold = Household.ActiveHousehold;
        }
开发者ID:GnatGoSplat,项目名称:NRaas,代码行数:7,代码来源:AttractionHelper.cs


示例9: Allow

        protected override bool Allow(Lot lot, Household me)
        {
            if (!base.Allow(lot, me)) return false;

            if (lot.IsCommunityLot) return false;

            return (new HomeInspection(lot).Satisfies(me).Count > 0);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:8,代码来源:FocusHomeInspection.cs


示例10: Allow

        protected override bool Allow(Lot lot, Household house)
        {
            if (!base.Allow(lot, house)) return false;

            if (lot is WorldLot) return false;

            return (lot != null);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:8,代码来源:SortLotInventory.cs


示例11: Allow

        protected override bool Allow(Lot lot, Household me)
        {
            if (!base.Allow(lot, me)) return false;

            if (lot == null) return false;

            return (true);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:8,代码来源:CleanAll.cs


示例12: GetTaxes

        protected static void GetTaxes(Household me, out int owed, out int savings, out int vacationHome)
        {
            owed = (int)(me.ComputeNetWorthOfObjectsInHousehold(true) * Mailbox.kPercentageOfWealthBilled);

            vacationHome = 0;

            savings = 0;

            if (me.RealEstateManager != null)
            {
                int valueOfAllVacationHomes = me.RealEstateManager.GetValueOfAllVacationHomes();

                vacationHome = (int)Math.Round((double)(valueOfAllVacationHomes * RealEstateManager.kPercentageOfVacationHomeValueBilled));

                owed += vacationHome;
            }

            if (me.LotHome != null)
            {
                Dictionary<int, List<float>> dictionary = new Dictionary<int, List<float>>();
                foreach (IReduceBills bills in me.LotHome.GetObjects<IReduceBills>())
                {
                    List<float> list;
                    int key = bills.ReductionArrayIndex();
                    float item = bills.PercentageReduction();
                    if (dictionary.TryGetValue(key, out list))
                    {
                        list.Add(item);
                    }
                    else
                    {
                        List<float> list2 = new List<float>();
                        list2.Add((float)bills.MaxNumberContributions());
                        list2.Add(item);
                        dictionary.Add(key, list2);
                    }
                }

                foreach (KeyValuePair<int, List<float>> pair in dictionary)
                {
                    int num5 = (int)pair.Value[0];
                    pair.Value.RemoveAt(0);
                    pair.Value.Sort();
                    int count = pair.Value.Count;
                    num5 = Math.Min(num5, count);
                    float num7 = 0f;
                    for (int i = 1; i <= num5; i++)
                    {
                        num7 += pair.Value[count - i];
                    }
                    int amount = (int)(owed * num7);

                    owed -= amount;

                    savings += amount;
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:58,代码来源:StatusBase.cs


示例13: GhostToPlayableGhost

        // Lacks the "greater than eight" restriction
        public static bool GhostToPlayableGhost(Urnstone ths, Household newHousehold, Vector3 ghostPosition)
        {
            SimDescription simDescription = ths.DeadSimsDescription;

            if (!simDescription.IsValidDescription)
            {
                simDescription.Fixup();
            }

            if (simDescription.Household != null)
            {
                simDescription.Household.Remove(simDescription, !simDescription.Household.IsSpecialHousehold);
            }

            if (!newHousehold.Contains(simDescription))
            {
                newHousehold.Add(simDescription);
            }

            Sim ghost = Instantiation.Perform(simDescription, ghostPosition, null, null);
            if (ghost == null) return false;

            ths.GhostSetup(ghost, true);

            ths.RemoveMourningRelatedBuffs(ghost);

            simDescription.ShowSocialsOnSim = true;
            simDescription.IsNeverSelectable = false;
            simDescription.Marryable = true;
            simDescription.Contactable = true;

            if (!simDescription.IsEP11Bot)
            {
                simDescription.AgingEnabled = true;
                simDescription.AgingState.ResetAndExtendAgingStage(0f);
                simDescription.PushAgingEnabledToAgingManager();
            }

            string failureReason;
            if (!Inventories.TryToMove(ths, ghost.Inventory, true, out failureReason))
            {
                Common.DebugNotify(failureReason);
            }
            //Inventories.TryToMove(ths, ghost);

            if (simDescription.Child || simDescription.Teen)
            {
                simDescription.AssignSchool();
            }

            if (ghost.IsSelectable)
            {
                ghost.OnBecameSelectable();
            }

            return true;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:58,代码来源:Urnstones.cs


示例14: Allow

 protected override bool Allow(Household house)
 {
     if (house.LotHome != null)
     {
         IncStat("Resident");
         return false;
     }
     return base.Allow(house);
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:9,代码来源:NewcomerFailScenario.cs


示例15: CareerStore

        public CareerStore(Household house, SafeStore.Flag flags)
        {
            mSafeStore = new Dictionary<ulong, SafeStore>();

            foreach (SimDescription sim in Households.All(house))
            {
                mSafeStore[sim.SimDescriptionId] = new SafeStore(sim, flags);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:9,代码来源:CareerStore.cs


示例16: Handle

        protected override Scenario Handle(Event e, ref ListenerAction result)
        {
            mEvent = e as HouseholdUpdateEvent;
            if (mEvent == null) return null;

            mOldHousehold = StoryProgression.Main.Households.ActiveHousehold;

            return base.Handle(e, ref result);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:9,代码来源:HouseChangedBaseScenario.cs


示例17: PrivatePerform

        protected override OptionResult PrivatePerform(Lot lot, Household me, List<IMiniSimDescription> sims)
        {
            OptionResult result = base.PrivatePerform(lot, me, sims);
            if (result == OptionResult.Failure) return OptionResult.Failure;

            SetRoommate(lot, me, sims);

            return result;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:9,代码来源:AddRoommate.cs


示例18: AddCheck

        public static void AddCheck(Household house)
        {
            if (!Vector.Settings.mAllowInactivePurchases) return;

            if (SimTypes.IsSpecial(house)) return;

            if (sChecks.ContainsKey(house)) return;

            sChecks.Add(house, true);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:10,代码来源:PurchaseControl.cs


示例19: Allow

        protected override bool Allow(Lot lot, Household me)
        {
            if (!base.Allow(lot, me)) return false;

            if (me == null) return false;

            if (me.RealEstateManager == null) return false;

            return true;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:10,代码来源:RealEstate.cs


示例20: Allow

        protected override bool Allow(Lot lot, Household me)
        {
            if (!base.Allow(lot, me)) return false;

            if (lot == null) return false;

            if (me == Household.ActiveHousehold) return false;

            return (me != null);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:10,代码来源:MakeHomeless.cs



注:本文中的Household类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# HraModelChangedEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# HotSpotDistance类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap