/// <summary> /// /// </summary> /// <param name="other"></param> public void SwapOs1516Data(KronosSetListSlot other) { int os1516Bank = Util.GetInt(PcgRoot.Content, Stl2BankOffset, 1); int os1516Patch = Util.GetInt(PcgRoot.Content, Stl2PatchOffset, 1); Util.SetInt(PcgRoot, PcgRoot.Content, Stl2BankOffset, 1, Util.GetInt(PcgRoot.Content, other.Stl2BankOffset, 1)); Util.SetInt(PcgRoot, PcgRoot.Content, Stl2PatchOffset, 1, Util.GetInt(PcgRoot.Content, other.Stl2PatchOffset, 1)); Util.SetInt(PcgRoot, PcgRoot.Content, other.Stl2BankOffset, 1, os1516Bank); Util.SetInt(PcgRoot, PcgRoot.Content, other.Stl2PatchOffset, 1, os1516Patch); }
/// <summary> /// /// </summary> /// <param name="otherPatch"></param> /// <param name="includingName"></param> /// <param name="maxDiffs"></param> /// <returns></returns> public override int CalcByteDifferences(IPatch otherPatch, bool includingName, int maxDiffs) { int diffs = base.CalcByteDifferences(otherPatch, includingName, maxDiffs); // Take SLS2 differences into account. if (PcgRoot.Model.OsVersion == Models.EOsVersion.Kronos15_16) { KronosSetListSlot otherSetListSlot = otherPatch as KronosSetListSlot; Debug.Assert(otherSetListSlot != null); diffs += (Util.GetInt(PcgRoot.Content, Stl2BankOffset, 1) != Util.GetInt(otherSetListSlot.PcgRoot.Content, otherSetListSlot.Stl2BankOffset, 1)) ? 1 : 0; diffs += (Util.GetInt(PcgRoot.Content, Stl2PatchOffset, 1) != Util.GetInt(otherSetListSlot.PcgRoot.Content, otherSetListSlot.Stl2PatchOffset, 1)) ? 1 : 0; } return(diffs); }