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


C# SimDescription.GetRelationship方法代码示例

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


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

示例1: GetKnownInfoList


//.........这里部分代码省略.........
                            else if ((otherSimDesc.CreatedByService != null) && Sims3.Gameplay.Services.Services.IsSimDescriptionInAnyServicePool(otherSimDesc))
                            {
                                string str4 = Localization.LocalizeString(otherSimDesc.IsFemale, "Gameplay/Services/Title:" + otherSimDesc.CreatedByService.ServiceType.ToString(), new object[0x0]);
                                list.Add(new KnownInfo(str4, ResourceKey.kInvalidResourceKey, KnownInfoType.Career));
                            }
                            else if ((otherSimDesc.AssignedRole != null) && !string.IsNullOrEmpty(otherSimDesc.AssignedRole.CareerTitleKey))
                            {
                                list.Add(new KnownInfo(Localization.LocalizeString(otherSimDesc.IsFemale, otherSimDesc.AssignedRole.CareerTitleKey, new object[0x0]), ResourceKey.kInvalidResourceKey, KnownInfoType.Career));
                            }
                            else if (((careerManager != null) && (careerManager.Occupation == null)) && (careerManager.RetiredCareer != null))
                            {
                                list.Add(new KnownInfo(Localization.LocalizeString("Ui/Caption/HUD/Career:Retired", new object[0x0]), ResourceKey.CreatePNGKey(careerManager.RetiredCareer.CareerIcon, 0x0), KnownInfoType.Career));
                            }
                            else
                            {
                                list.Add(new KnownInfo(Localization.LocalizeString(otherSimDesc.IsFemale, "Ui/Caption/HUD/KnownInfoDialog:Unemployed", new object[0x0]), ResourceKey.kInvalidResourceKey, KnownInfoType.Career));
                            }
                        }
                    }

                    msg += "D";

                    if (learnedInfo.PartnerKnown)
                    {
                        string firstName = null;
                        ResourceKey relationshipImageKey = ResourceKey.kInvalidResourceKey;
                        if (otherSimDesc.Partner != null)
                        {
                            msg += "D1";

                            firstName = otherSimDesc.Partner.FirstName;

                            // Custom : false -> true
                            Relationship relationship = otherSimDesc.GetRelationship(otherSimDesc.Partner, true);
                            if (relationship != null)
                            {
                                relationshipImageKey = RelationshipFunctions.GetLTRRelationshipImageKey(relationship.LTR.CurrentLTR, relationship.IsPetToPetRelationship);
                            }
                        }
                        else
                        {
                            msg += "D2";

                            if (otherSimDesc.HomeWorld != GameUtils.GetCurrentWorld())
                            {
                                MiniSimDescription description2 = MiniSimDescription.Find(otherSimDesc.SimDescriptionId);
                                if ((description2 != null) && (description2.PartnerId != 0x0L))
                                {
                                    MiniSimDescription otherSim = MiniSimDescription.Find(description2.PartnerId);
                                    if (otherSim != null)
                                    {
                                        firstName = otherSim.FirstName;
                                        MiniRelationship miniRelationship = description2.GetMiniRelationship(otherSim) as MiniRelationship;
                                        if (miniRelationship != null)
                                        {
                                            relationshipImageKey = RelationshipFunctions.GetLTRRelationshipImageKey(miniRelationship.CurrentLTR, miniRelationship.IsPetToPetRelationship);
                                        }
                                    }
                                }
                            }

                            if (string.IsNullOrEmpty(firstName))
                            {
                                firstName = Localization.LocalizeString("Ui/Caption/HUD/KnownInfoDialog:None", new object[0x0]);
                            }
                        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:67,代码来源:HudModelEx.cs

示例2: GetStatus


//.........这里部分代码省略.........
                    }
                }

                if(Tagger.Settings.mTagDataSettings[TagDataType.LifetimeHappiness] && sim.LifetimeHappiness > 0)
                {
                    if (!Tagger.Settings.mTagDataSettings[TagDataType.LifetimeWant] || (Tagger.Settings.mTagDataSettings[TagDataType.LifetimeWant] && !sim.HasLifetimeWish))
                    {
                        str += Common.NewLine;
                    }
                    else
                    {
                        str += " ";
                    }

                    str += Common.Localize("TagData:LifetimeHappinessSpendable", sim.IsFemale, new object[] { sim.LifetimeHappiness, sim.SpendableHappiness});
                }

                if (Tagger.Settings.mTagDataSettings[TagDataType.Job])
                {
                    if (sim.Occupation != null)
                    {
                        str += Common.NewLine;
                        if (sim.Occupation.OfficeLocation != null)
                        {
                            str += Common.Localize("TagData:JobAt", sim.IsFemale, new object[] { sim.Occupation.CurLevelJobTitle, sim.Occupation.OfficeLocation.GetLocalizedName() });
                        }
                        else
                        {
                            str += Common.Localize("TagData:JobTag", sim.IsFemale, new object[] { sim.Occupation.CurLevelJobTitle });
                        }
                    }
                }

                if (Tagger.Settings.mTagDataSettings[TagDataType.PartnerInfo])
                {
                    if (sim.Partner != null)
                    {
                        Relationship rel = sim.GetRelationship(sim.Partner, false);
                        string status = "Happily";
                        if (rel != null)
                        {                            
                            if (rel.CurrentLTRLiking < -15)
                            {
                                status = "Unhappily";
                            }                            
                        }

                        str += Common.NewLine;

                        if (sim.IsMarried)
                        {
                            str += Common.Localize("TagData:Spouse", sim.IsFemale, new object[] { Common.Localize("TagData:" + status), sim.Partner });
                        }
                        else
                        {
                            str += Common.Localize("TagData:Partner", sim.IsFemale, new object[] { sim.Partner });
                        }
                    }
                }
            }

            if (sim.IsPregnant && Tagger.Settings.mTagDataSettings[TagDataType.PregnancyInfo])
            {
                IMiniSimDescription father = SimDescription.Find(sim.Pregnancy.DadDescriptionId);
                if (father == null)
                {
                    father = MiniSimDescription.Find(sim.Pregnancy.DadDescriptionId);
                }

                str += Common.NewLine;

                if (father != null)
                {
                    if (sim.Partner != null && father != sim.Partner && !sim.IsPet)
                    {
                        string uhoh = Common.Localize("TagData:Uhoh");
                        str += Common.Localize("TagData:Pregnancy", sim.IsFemale, new object[] { father, uhoh });
                    }
                    else
                    {
                        str += Common.Localize("TagData:Pregnancy", sim.IsFemale, new object[] { father });
                    }
                }
                else
                {
                    str += Common.Localize("TagData:PregnancyUnknown", sim.IsFemale);
                }
            }

            if (Tagger.Settings.mTagDataSettings[TagDataType.PersonalityInfo] && sGetClanInfo.Valid)
            {
                List<string> info = sGetClanInfo.Invoke<List<string>>(new object [] { sim });
                foreach (string personality in info)
                {
                    str += Common.NewLine + personality;
                }
            }

            return str;
        }
开发者ID:KhArtNJava,项目名称:NRaas,代码行数:101,代码来源:TagDataHelper.cs

示例3: CanGetRomantic


//.........这里部分代码省略.........
                {
                    if (Woohooer.Settings.mDisallowAutonomousServiceTypes.Contains(target.CreatedByService.ServiceType))
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("Target Service Fail");
                        reason = "Target Service Fail";
                        return false;
                    }
                }

                if ((me.CreatedSim != null) && (target.CreatedSim != null))
                {
                    BuffBetrayed.BuffInstanceBetrayed betrayed;
                    if (BuffBetrayed.DoesSimFeelBetrayed(me.CreatedSim, target, out betrayed))
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("Betrayed Fail");
                        reason = "Betrayed Fail";
                        return false;
                    }
                    if (!OccultImaginaryFriend.CanSimGetRomanticWithSim(me.CreatedSim, target.CreatedSim))
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("Imaginary Fail");
                        reason = "Imaginary Fail";
                        return false;
                    }
                }
            }

            if ((tryingToWooHoo) && (autonomous))
            {
                if (Woohooer.Settings.mMustBeRomanticForAutonomousV2[PersistedSettings.GetSpeciesIndex(me)])
                {
                    if ((!KamaSimtra.IsWhoring(me)) && (!KamaSimtra.IsWhoring(target)))
                    {
                        Relationship relation = me.GetRelationship(target, false);
                        if ((relation == null) || (!relation.AreRomantic()))
                        {
                            greyedOutTooltipCallback = Common.DebugTooltip("Must Be Romantic Fail");
                            reason = "Must Be Romantic Fail";
                            return false;
                        }
                    }
                }
            }

            if (testLiking)
            {
                if ((autonomous) || (Woohooer.Settings.mLikingGateForUserDirected))
                {
                    if (!SatisfiesLikingGate(me, target, tryingToWooHoo))
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("Liking Gate Fail (2)");
                        reason = "Liking Gate Fail (2)";
                        return false;
                    }
                }
            }

            if ((me.ChildOrBelow) || (target.ChildOrBelow))
            {
                greyedOutTooltipCallback = Common.DebugTooltip("Age Fail");
                reason = "Age Fail";
                return false;
            }

            if (!Woohooer.Settings.AllowNearRelation(me.Species, tryingToWooHoo, autonomous))
            {
开发者ID:Robobeurre,项目名称:NRaas,代码行数:67,代码来源:CommonSocials.cs


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