private static void AssertOrigTransPT(List <string> origList, List <string> transList) { var pTList = BuildPTList(origList, transList); var tt = new TranslationText("", "", pTList); GetOrigAssert(tt, pTList); GetTransAssert(tt, pTList); }
protected bool Equals(PowerPraiseSongFormatting other) { return(MainText.Equals(other.MainText) && TranslationText.Equals(other.TranslationText) && CopyrightText.Equals(other.CopyrightText) && SourceText.Equals(other.SourceText) && Outline.Equals(other.Outline) && Shadow.Equals(other.Shadow) && MainLineSpacing == other.MainLineSpacing && TranslationLineSpacing == other.TranslationLineSpacing && Equals(TextOrientation, other.TextOrientation) && TranslationPosition == other.TranslationPosition && CopyrightTextPosition == other.CopyrightTextPosition && SourceTextPosition == other.SourceTextPosition && Borders.Equals(other.Borders)); }
public override int GetHashCode() { unchecked { var hashCode = MainText.GetHashCode(); hashCode = (hashCode * 397) ^ TranslationText.GetHashCode(); hashCode = (hashCode * 397) ^ CopyrightText.GetHashCode(); hashCode = (hashCode * 397) ^ SourceText.GetHashCode(); hashCode = (hashCode * 397) ^ Outline.GetHashCode(); hashCode = (hashCode * 397) ^ Shadow.GetHashCode(); hashCode = (hashCode * 397) ^ MainLineSpacing; hashCode = (hashCode * 397) ^ TranslationLineSpacing; hashCode = (hashCode * 397) ^ (TextOrientation != null ? TextOrientation.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)TranslationPosition; hashCode = (hashCode * 397) ^ (int)CopyrightTextPosition; hashCode = (hashCode * 397) ^ (int)SourceTextPosition; hashCode = (hashCode * 397) ^ Borders.GetHashCode(); return(hashCode); } }
/// <summary> /// Returns a hashcode of the song, used for example in the /// editor to check if the file was changed /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = (int)CopyrightPosition; hashCode = (hashCode * 397) ^ (int)SourcePosition; hashCode = (hashCode * 397) ^ (MainText != null ? MainText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TranslationText != null ? TranslationText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CopyrightText != null ? CopyrightText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SourceText != null ? SourceText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ MainLineSpacing; hashCode = (hashCode * 397) ^ TranslationLineSpacing; hashCode = (hashCode * 397) ^ (TextOrientation != null ? TextOrientation.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)TranslationPosition; hashCode = (hashCode * 397) ^ TextOutlineEnabled.GetHashCode(); hashCode = (hashCode * 397) ^ TextShadowEnabled.GetHashCode(); hashCode = (hashCode * 397) ^ (TextBorders != null ? TextBorders.GetHashCode() : 0); return(hashCode); } }
private static void GetTransAssert(TranslationText trans, List <PTrans> pTList) { var x = pTList[pTList.Count - 1].TransPos + pTList[pTList.Count - 1].TransText.Length + 10; // 余分な長さまで確認 var pt = trans.GetTrans(-1); // 負数を渡すと先頭を返す AssertPT(pTList[0], pt); var idx = 0; for (var i = 0; i < x; i++) { if (i >= pTList[idx].OrigPos + pTList[idx].OrigText.Length) { if (idx < pTList.Count - 1) { idx++; } } pt = trans.GetTrans(i); AssertPT(pTList[idx], pt); } }