Пример #1
0
        public void Associate(DialogueBase other)
        {
            this.otherDialogue = other;

            if (other != null)
            {
                other.otherDialogue = this;
            }
        }
Пример #2
0
        //Write statisics on which lines were not matched
        static void WriteAlignmentStatistics(List <AlignmentPoint> alignmentPoints, string outputPath)
        {
            List <AlignmentPoint> unalignedPoints    = alignmentPoints.Where(alignmentPoint => alignmentPoint.mangaGamerDialogue == null || alignmentPoint.ps3DialogFragment == null).ToList();
            List <AlignmentPoint> unalignedMGPoints  = unalignedPoints.Where(alignmentPoint => alignmentPoint.ps3DialogFragment == null).ToList();
            List <AlignmentPoint> unalignedPS3Points = unalignedPoints.Where(alignmentPoint => alignmentPoint.mangaGamerDialogue == null).ToList();

            StringBuilder reportSB = new StringBuilder();

            reportSB.AppendLine("See [INPUT_SCRIPT_NAME]_side_by_side_debug.html for detailed diff information.");
            reportSB.AppendLine($"Num unaligned MG : {unalignedMGPoints.Count ,10} instructions ({(double)unalignedMGPoints.Count  / alignmentPoints.Count:P})");
            reportSB.AppendLine($"Num unaligned PS3: {unalignedPS3Points.Count,10} instructions ({(double)unalignedPS3Points.Count / alignmentPoints.Count:P})");
            reportSB.AppendLine($"Unaligned Entries Follow....");
            reportSB.AppendLine("---------------------------------------------------------------------------------\n");

            foreach (var alignmentPoint in unalignedPoints)
            {
                bool         isMangaGamerDialogue = alignmentPoint.mangaGamerDialogue != null;
                string       alignmentPointType   = isMangaGamerDialogue ? "MG " : "PS3";
                DialogueBase dialogueToPrint      = isMangaGamerDialogue ? (DialogueBase)alignmentPoint.mangaGamerDialogue : (DialogueBase)alignmentPoint.ps3DialogFragment;
                string       IDString             = dialogueToPrint.ID.ToString();

                if (!isMangaGamerDialogue)
                {
                    //Format ID string differently for PS3 because it has a fragment ID
                    IDString = $"{alignmentPoint.ps3DialogFragment.ID}.{alignmentPoint.ps3DialogFragment.fragmentID}";

                    //Only for PS3: print out any previous XML instructions
                    foreach (var previousLineOrInstruction in dialogueToPrint.previousLinesOrInstructions)
                    {
                        reportSB.AppendLine($"\t\t|------: {previousLineOrInstruction} ({alignmentPointType} [{IDString,7}])");
                    }
                }

                reportSB.AppendLine($"{alignmentPointType} [{IDString,8}]: {dialogueToPrint.data}");
            }

            File.WriteAllText(outputPath, reportSB.ToString());
        }