Ejemplo n.º 1
0
        public static InnerSpaceGameProfile FindGlobalGameProfile(InnerSpaceGameProfile likeThis)
        {
            if (GameProfiles == null || likeThis == null)
            {
                return(likeThis);
            }

            InnerSpaceGameProfile found = GameProfiles.FirstOrDefault(q => q.Game.Equals(likeThis.Game, StringComparison.InvariantCultureIgnoreCase) && q.GameProfile.Equals(likeThis.GameProfile, StringComparison.InvariantCultureIgnoreCase));

            if (found == null)
            {
                return(likeThis);
            }

            return(found);
        }
Ejemplo n.º 2
0
        static void ReloadGameProfiles()
        {
            InnerSpaceGameProfile gpSingularity = Settings.SingularityGameProfile;
            InnerSpaceGameProfile gpTranquility = Settings.TranquilityGameProfile;

            if (_GameProfiles == null)
            {
                _GameProfiles = new ObservableCollection <InnerSpaceGameProfile>();
            }
            else
            {
                _GameProfiles.Clear();
            }

            if (GameConfiguration != null)
            {
                if (GameConfiguration.Sets != null)
                {
                    foreach (Set gameSet in GameConfiguration.Sets)
                    {
                        Set profilesSet = gameSet.FindSet("Profiles");
                        if (profilesSet == null || profilesSet.Sets == null)
                        {
                            continue;
                        }

                        foreach (Set gameProfileSet in profilesSet.Sets)
                        {
                            InnerSpaceGameProfile gp = new InnerSpaceGameProfile()
                            {
                                Game = gameSet.Name, GameProfile = gameProfileSet.Name
                            };
                            _GameProfiles.Add(gp);
                        }
                    }
                }
            }

            Settings.SingularityGameProfile = App.FindGlobalGameProfile(gpSingularity);
            Settings.TranquilityGameProfile = App.FindGlobalGameProfile(gpTranquility);
        }