当前位置: 首页>>代码示例>>C#>>正文


C# Sim.CanGetRomantic方法代码示例

本文整理汇总了C#中Sim.CanGetRomantic方法的典型用法代码示例。如果您正苦于以下问题:C# Sim.CanGetRomantic方法的具体用法?C# Sim.CanGetRomantic怎么用?C# Sim.CanGetRomantic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sim的用法示例。


在下文中一共展示了Sim.CanGetRomantic方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetUnfilteredSocials

        private static List<InteractionObjectPair> GetUnfilteredSocials(SocialComponent ths, Sim actor, Sim target, Relationship r)
        {
            bool isAutonomous = false;
            List<InteractionObjectPair> results = new List<InteractionObjectPair>();
            if (actor != target)
            {
                int numSocials = STCData.GetNumSocials(ths.Conversation);
                SocialInteractionCandidateCollection candidates = new SocialInteractionCandidateCollection(actor, target, r, ths.Conversation, isAutonomous);
                foreach (CommodityTypes types in CommodityData.AllPlayableCommodities)
                {
                    sMsg += Common.NewLine + "CommodityType: " + types;
                    switch (types)
                    {
                        case CommodityTypes.Amorous:
                            {
                                if (actor.CanGetRomantic(target, false))
                                {
                                    break;
                                }
                                results.Add(new InteractionObjectPair(Sim.BetrayedSimsFutileRomance.Singleton, target));

                                sMsg += Common.NewLine + "Amorous Denied";
                                continue;
                            }
                        case CommodityTypes.Steamed:
                            {
                                if (!r.STC.IsPositive)
                                {
                                    break;
                                }

                                sMsg += Common.NewLine + "Steamed Denied";
                                continue;
                            }
                        case CommodityTypes.Insulting:
                            if (isAutonomous && actor.BuffManager.HasElement(BuffNames.Admonished))
                            {
                                sMsg += Common.NewLine + "Insulting Denied";
                                continue;
                            }
                            break;
                    }
                    int maxNumSocials = numSocials;
                    if (CommodityData.AppearsAsSubMenu(types))
                    {
                        GetSocialsForSTC(types, actor, target, r, ths.Conversation, isAutonomous);

                        List<SocialInteractionCandidate> socialsFor = candidates.GetSocialsFor(types);
                        if (socialsFor != null)
                        {
                            string changeToneText = CommodityData.Get(types).GetChangeToneText();
                            AddSocials("1", ths, types, actor, target, socialsFor, isAutonomous, maxNumSocials, results, new string[] { changeToneText }, TraitNames.Unknown);
                            if (types == CommodityTypes.Friendly)
                            {
                                List<SocialInteractionCandidate> socials = candidates.GetSocialsFor(CommodityTypes.Neutral);
                                if (socials != null)
                                {
                                    AddSocials("2", ths, CommodityTypes.Neutral, actor, target, socials, isAutonomous, maxNumSocials, results, new string[] { changeToneText }, TraitNames.Unknown);
                                }
                            }
                        }
                    }
                }

                string str3 = Common.LocalizeEAString("Gameplay/Socializing:Special");
                foreach (Trait trait in actor.TraitManager.List)
                {
                    List<SocialInteractionCandidate> list4 = candidates.GetSocialsFor(trait.Guid);
                    if ((list4 != null) && (list4.Count > 0x0))
                    {
                        string str5 = trait.TraitName(actor.IsFemale);
                        string[] inlineParentMenu = new string[] { str3, str5 + Localization.Ellipsis };
                        AddSocials("3", ths, CommodityTypes.Undefined, actor, target, list4, isAutonomous, numSocials, results, inlineParentMenu, trait.Guid);
                    }
                }
                if (((ths.Conversation != null) && (actor.Household != target.Household)) && ((!actor.IsAtHome || target.IsAtHome) && (actor.IsAtHome || !target.IsAtHome)))
                {
                    SocialInteractionCandidate candidate = new SocialInteractionCandidate(ths.GetGoodbyeSocial(actor, target), new string[0], null);
                    AddSocials("4", ths, CommodityTypes.Undefined, actor, target, new List<SocialInteractionCandidate>(new SocialInteractionCandidate[] { candidate }), isAutonomous, numSocials, results, new string[0x0], TraitNames.Unknown);
                }
            }
            return results;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:83,代码来源:TestPopupMenu.cs

示例2: GetUnfilteredSocials

        // From SocialComponent
        private static List<InteractionObjectPair> GetUnfilteredSocials(SocialComponent ths, Sim actor, Sim target, Relationship r)
        {
            string msg = actor.FullName;
            msg += Common.NewLine + target.FullName;

            bool isAutonomous = false;
            List<InteractionObjectPair> results = new List<InteractionObjectPair>();
            if (actor != target)
            {
                bool flag2;
                int numSocials = STCData.GetNumSocials(ths.Conversation);

                SocialInteractionCandidateCollection candidates = new SocialInteractionCandidateCollectionEx(actor, target, r, ths.Conversation, isAutonomous, ref msg);

                Conversation.GetCurrentSTC(actor, target, r, ths.Conversation, out flag2);
                foreach (CommodityTypes str in CommodityData.AllPlayableCommodities)
                {
                    using (Common.TestSpan span = new Common.TestSpan(TimeSpanLogger.Bin, "Commodity: " + str, Common.DebugLevel.Stats))
                    {
                        msg += Common.NewLine + "1 " + str;

                        switch (str)
                        {
                            case CommodityTypes.Amorous:
                                {
                                    if ((actor.CanGetRomantic(target, false) || !actor.SimDescription.IsHuman) || !target.SimDescription.IsHuman)
                                    {
                                        break;
                                    }
                                    results.Add(new InteractionObjectPair(Sim.BetrayedSimsFutileRomance.Singleton, target));
                                    continue;
                                }
                            case CommodityTypes.Steamed:
                                {
                                    if (!r.STC.IsPositive)
                                    {
                                        break;
                                    }
                                    continue;
                                }
                            case CommodityTypes.Insulting:
                                if (isAutonomous && actor.BuffManager.HasElement(BuffNames.Admonished))
                                {
                                    continue;
                                }
                                break;
                        }

                        msg += Common.NewLine + "2 " + str;

                        int num2 = numSocials;
                        if (CommodityData.AppearsAsSubMenu(str))
                        {
                            msg += Common.NewLine + "AppearsAsSubMenu " + str;

                            List<SocialInteractionCandidate> socialsFor = candidates.GetSocialsFor(str);
                            if (socialsFor != null)
                            {
                                msg += Common.NewLine + "socialsFor " + str + " " + socialsFor.Count;

                                string changeToneText = CommodityData.Get(str).GetChangeToneText();
                                AddSocials(ths, actor, target, socialsFor, isAutonomous, num2, results, new string[] { changeToneText }, TraitNames.Unknown, ref msg);
                                if (str == CommodityTypes.Friendly)
                                {
                                    List<SocialInteractionCandidate> socials = candidates.GetSocialsFor(CommodityTypes.Neutral);
                                    if (socials != null)
                                    {
                                        AddSocials(ths, actor, target, socials, isAutonomous, num2, results, new string[] { changeToneText }, TraitNames.Unknown, ref msg);
                                    }
                                }
                            }
                        }
                    }
                }

                string str3 = Localization.LocalizeString("Gameplay/Socializing:Special", new object[0x0]);
                foreach (Trait trait in actor.TraitManager.List)
                {
                    List<SocialInteractionCandidate> list4 = candidates.GetSocialsFor(trait.Guid);
                    if ((list4 != null) && (list4.Count > 0x0))
                    {
                        string str5 = trait.TraitName(actor.IsFemale);
                        string[] inlineParentMenu = new string[] { str3, str5 + Localization.Ellipsis };
                        AddSocials(ths, actor, target, list4, isAutonomous, numSocials, results, inlineParentMenu, trait.Guid, ref msg);
                    }
                }

                if (((ths.Conversation != null) && (actor.Household != target.Household)) && ((!actor.IsAtHome || target.IsAtHome) && (actor.IsAtHome || !target.IsAtHome)))
                {
                    SocialInteractionCandidate candidate = new SocialInteractionCandidate(ths.GetGoodbyeSocial(actor, target), new string[0], null);
                    ths.AddSocials(actor, target, new List<SocialInteractionCandidate>(new SocialInteractionCandidate[] { candidate }), isAutonomous, numSocials, results, new string[0x0], TraitNames.Unknown);
                }
            }

            Common.WriteLog(msg);

            return results;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:99,代码来源:TestSocials.cs


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