Beispiel #1
0
        public static List <SocialInteractionCandidate> Get(Sim actor, Sim target, ShortTermContextTypes category, LongTermRelationshipTypes group, bool isActive, ActiveTopic topic, bool isAutonomous, ref string msg)
        {
            Dictionary <LongTermRelationshipTypes, Dictionary <bool, List <string> > > dictionary;
            List <SocialInteractionCandidate> list = new List <SocialInteractionCandidate>();

            if (ActionAvailabilityData.sStcInteractions.TryGetValue(category, out dictionary))
            {
                Dictionary <bool, List <string> > dictionary2;
                List <string> list2;
                bool          flag = dictionary.TryGetValue(group, out dictionary2);
                if (!flag)
                {
                    group = LongTermRelationshipTypes.Default;
                    flag  = dictionary.TryGetValue(group, out dictionary2);
                }
                if (!flag || !dictionary2.TryGetValue(isActive, out list2))
                {
                    msg += Common.NewLine + "Get Fail 1 " + category;
                    return(list);
                }

                msg += Common.NewLine + "Get Found " + category + " " + list2.Count;

                foreach (string str in list2)
                {
                    ActionData data = ActionData.Get(str);
                    GreyedOutTooltipCallback greyedOutTooltipCallback = null;

                    InteractionTestResult result = data.Test(actor, target, isAutonomous, topic, ref greyedOutTooltipCallback);

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

                    if ((IUtil.IsPass(result) || (greyedOutTooltipCallback != null)) || Sims3.Gameplay.UI.PieMenu.PieMenuShowFailureReason)
                    {
                        list.Add(new SocialInteractionCandidate(str, data.GetParentMenu(actor, target), topic));
                    }
                }
            }
            else
            {
                msg += Common.NewLine + "Get Fail 2 " + category;
            }

            return(list);
        }
Beispiel #2
0
        private static List <SocialInteractionCandidate> GetInternal(string name, Sim actor, Sim target, LongTermRelationshipTypes group, bool isActive, ActiveTopic topic, bool isAutonomous, Dictionary <LongTermRelationshipTypes, Dictionary <bool, List <string> > > interactionCategories)
        {
            Dictionary <bool, List <string> > dictionary;
            List <string> list2;
            bool          flag = interactionCategories.TryGetValue(group, out dictionary);

            if (!flag)
            {
                sMsg += Common.NewLine + " Try Default";

                group = LongTermRelationshipTypes.Default;
                flag  = interactionCategories.TryGetValue(group, out dictionary);
            }
            List <SocialInteractionCandidate> list = new List <SocialInteractionCandidate>();

            if (flag && dictionary.TryGetValue(isActive, out list2))
            {
                sMsg += Common.NewLine + " Choices = " + list2.Count;

                foreach (string str in list2)
                {
                    ActionData data = ActionData.Get(str);
                    GreyedOutTooltipCallback greyedOutTooltipCallback = null;

                    InteractionTestResult result = data.Test(actor, target, isAutonomous, topic, ref greyedOutTooltipCallback);

                    sMsg += Common.NewLine + "  " + str + " = " + result;

                    if ((IUtil.IsPass(result) || (greyedOutTooltipCallback != null)) || Sims3.Gameplay.UI.PieMenu.PieMenuShowFailureReason)
                    {
                        list.Add(new SocialInteractionCandidate(str, data.GetParentMenu(actor, target), topic));
                    }
                }
            }
            return(list);
        }