예제 #1
0
        private void MergeCommentaryResourcesCollections()
        {
            // Update commentary resources collection with changes to driver prefixes for 67-231, 244-284
            foreach (var item in CommentaryResourcesDriverPrefixes)
            {
                var transcriptPrefix = CommentaryIndicesDriver.First(x => x.CommentaryIndex == item.Id).ResourceText;

                // P1
                var p1Destination = CommentaryResources.Single(x => x.Id == item.Id); // 67
                p1Destination.FileNamePrefix   = item.FileNamePrefix;
                p1Destination.TranscriptPrefix = transcriptPrefix;

                // P2
                var p2Destination = CommentaryResources.Single(x => x.Id == item.Id + 41); // 108
                p2Destination.FileNamePrefix   = item.FileNamePrefix;
                p2Destination.TranscriptPrefix = transcriptPrefix;

                // P3
                var p3Destination = CommentaryResources.Single(x => x.Id == item.Id + 82); // 149
                p3Destination.FileNamePrefix   = item.FileNamePrefix;
                p3Destination.TranscriptPrefix = transcriptPrefix;

                // Out
                var outDestination = CommentaryResources.Single(x => x.Id == item.Id + 123); // 190
                outDestination.FileNamePrefix   = item.FileNamePrefix;
                outDestination.TranscriptPrefix = transcriptPrefix;

                // Pits
                var pitsDestination = CommentaryResources.Single(x => x.Id == item.Id + 176); // 243
                pitsDestination.FileNamePrefix   = item.FileNamePrefix;
                pitsDestination.TranscriptPrefix = transcriptPrefix;
            }

            // Update commentary resources collection with changes to team prefixes for 231-241
            foreach (var item in CommentaryResourcesTeamPrefixes)
            {
                var transcriptPrefix = CommentaryIndicesTeam.First(x => x.CommentaryIndex == item.Id).ResourceText;

                // Out
                var outDestination = CommentaryResources.Single(x => x.Id == item.Id); // 231
                outDestination.FileNamePrefix   = item.FileNamePrefix;
                outDestination.TranscriptPrefix = transcriptPrefix;
            }
        }
예제 #2
0
        private void ImportCommentaryResources(string gameFolderPath, string commentaryResourceFilePath)
        {
            using (var connection = new CommentaryResourceConnection(commentaryResourceFilePath))
            {
                CommentaryResources = connection.Load();
            }

            CommentaryResourcesDriverPrefixes = new Collection <CommentaryResource>();
            foreach (var item in CommentaryResources.Where(x => x.Id >= 67 && x.Id <= 107))
            {
                CommentaryResourcesDriverPrefixes.Add(item);
            }

            CommentaryResourcesTeamPrefixes = new Collection <CommentaryResource>();
            foreach (var item in CommentaryResources.Where(x => x.Id >= 231 && x.Id <= 241))
            {
                CommentaryResourcesTeamPrefixes.Add(item);
            }

            CommentaryResourcesWavSoundFiles = new Collection <StringValue>(GetCommentaryResourcesWavSoundFiles(gameFolderPath));
        }