Exemplo n.º 1
0
        internal GameInfo GetGameInfoFromTitle(TitleHistoryResponse.Title title)
        {
            var newGame = new GameInfo
            {
                GameId = title.pfn,
                Name   = title.name.
                         Replace("(PC)", "").
                         Replace("(Windows)", "").
                         Replace("for Windows 10", "").
                         Replace("- Windows 10", "").
                         Trim(),
                Platform = "PC",
                Source   = "Xbox"
            };

            if (title.detail != null)
            {
                if (title.detail.releaseDate != null)
                {
                    newGame.ReleaseDate = title.detail.releaseDate;
                }

                if (!title.detail.publisherName.IsNullOrEmpty())
                {
                    newGame.Publishers = title.detail.publisherName.Split(new char[] { '|' }).Select(a => a.Trim()).ToList();
                }

                if (!title.detail.developerName.IsNullOrEmpty())
                {
                    newGame.Developers = title.detail.developerName.Split(new char[] { '|' }).Select(a => a.Trim()).ToList();
                }
            }

            return(newGame);
        }
Exemplo n.º 2
0
        public void WriteAppDataCache(TitleHistoryResponse.Title data)
        {
            var filePath = Path.Combine(pfnInfoCacheDir, data.pfn + ".json");

            FileSystem.PrepareSaveFile(filePath);
            File.WriteAllText(filePath, Serialization.ToJson(data));
        }