public static void Save(ref byte[] saveData) { //58 int i = 0; //30 SaveAndRestore.SaveData(ref i, cPartyChance, ref saveData); SaveAndRestore.SaveData(ref i, gPartyChance, ref saveData); SaveAndRestore.SaveData(ref i, sPartyChance, ref saveData); SaveAndRestore.SaveData(ref i, lPartyChance, ref saveData); SaveAndRestore.SaveData(ref i, nPartyChance, ref saveData); SaveAndRestore.SaveData(ref i, cPartyTickets, ref saveData); SaveAndRestore.SaveData(ref i, gPartyTickets, ref saveData); SaveAndRestore.SaveData(ref i, sPartyTickets, ref saveData); SaveAndRestore.SaveData(ref i, lPartyTickets, ref saveData); SaveAndRestore.SaveData(ref i, nPartyTickets, ref saveData); SaveAndRestore.SaveData(ref i, cPartySeats, ref saveData); SaveAndRestore.SaveData(ref i, gPartySeats, ref saveData); SaveAndRestore.SaveData(ref i, sPartySeats, ref saveData); SaveAndRestore.SaveData(ref i, lPartySeats, ref saveData); SaveAndRestore.SaveData(ref i, nPartySeats, ref saveData); //14 SaveAndRestore.SaveData(ref i, nextMeetingInterval, ref saveData); SaveAndRestore.SaveData(ref i, case1, ref saveData); SaveAndRestore.SaveData(ref i, case2, ref saveData); SaveAndRestore.SaveData(ref i, case3, ref saveData); SaveAndRestore.SaveData(ref i, case4, ref saveData); SaveAndRestore.SaveData(ref i, case5, ref saveData); SaveAndRestore.SaveData(ref i, case6, ref saveData); SaveAndRestore.SaveData(ref i, case7, ref saveData); SaveAndRestore.SaveData(ref i, case8, ref saveData); SaveAndRestore.SaveData(ref i, currentBillId, ref saveData); SaveAndRestore.SaveData(ref i, currentYes, ref saveData); SaveAndRestore.SaveData(ref i, currentNo, ref saveData); SaveAndRestore.SaveData(ref i, currentNoAttend, ref saveData); //14 SaveAndRestore.SaveData(ref i, residentTax, ref saveData); SaveAndRestore.SaveData(ref i, commercialTax, ref saveData); SaveAndRestore.SaveData(ref i, industryTax, ref saveData); SaveAndRestore.SaveData(ref i, benefitOffset, ref saveData); residentTax = COMath.Clamp((int)residentTax, 0, 20); commercialTax = COMath.Clamp((int)commercialTax, 0, 20); industryTax = COMath.Clamp((int)industryTax, 0, 20); benefitOffset = (short)COMath.Clamp((int)benefitOffset, 0, 100); if (i != saveData.Length) { DebugLog.LogToFileOnly($"Politics Save Error: saveData.Length = {saveData.Length} + i = {i}"); } }
public static void Load(ref byte[] saveData) { int i = 0; SaveAndRestore.LoadData(ref i, saveData, ref cPartyChance); SaveAndRestore.LoadData(ref i, saveData, ref gPartyChance); SaveAndRestore.LoadData(ref i, saveData, ref sPartyChance); SaveAndRestore.LoadData(ref i, saveData, ref lPartyChance); SaveAndRestore.LoadData(ref i, saveData, ref nPartyChance); SaveAndRestore.LoadData(ref i, saveData, ref cPartyTickets); SaveAndRestore.LoadData(ref i, saveData, ref gPartyTickets); SaveAndRestore.LoadData(ref i, saveData, ref sPartyTickets); SaveAndRestore.LoadData(ref i, saveData, ref lPartyTickets); SaveAndRestore.LoadData(ref i, saveData, ref nPartyTickets); SaveAndRestore.LoadData(ref i, saveData, ref cPartySeats); SaveAndRestore.LoadData(ref i, saveData, ref gPartySeats); SaveAndRestore.LoadData(ref i, saveData, ref sPartySeats); SaveAndRestore.LoadData(ref i, saveData, ref lPartySeats); SaveAndRestore.LoadData(ref i, saveData, ref nPartySeats); SaveAndRestore.LoadData(ref i, saveData, ref nextMeetingInterval); SaveAndRestore.LoadData(ref i, saveData, ref case1); SaveAndRestore.LoadData(ref i, saveData, ref case2); SaveAndRestore.LoadData(ref i, saveData, ref case3); SaveAndRestore.LoadData(ref i, saveData, ref case4); SaveAndRestore.LoadData(ref i, saveData, ref case5); SaveAndRestore.LoadData(ref i, saveData, ref case6); SaveAndRestore.LoadData(ref i, saveData, ref case7); SaveAndRestore.LoadData(ref i, saveData, ref case8); SaveAndRestore.LoadData(ref i, saveData, ref currentBillId); SaveAndRestore.LoadData(ref i, saveData, ref currentYes); SaveAndRestore.LoadData(ref i, saveData, ref currentNo); SaveAndRestore.LoadData(ref i, saveData, ref currentNoAttend); SaveAndRestore.LoadData(ref i, saveData, ref residentTax); SaveAndRestore.LoadData(ref i, saveData, ref commercialTax); SaveAndRestore.LoadData(ref i, saveData, ref industryTax); SaveAndRestore.LoadData(ref i, saveData, ref benefitOffset); if (i != saveData.Length) { DebugLog.LogToFileOnly($"Politics Load Error: saveData.Length = {saveData.Length} + i = {i}"); } }