public override void OnEncodeToConfigNode() { VABBuildList.Clear(); SPHBuildList.Clear(); VABWarehouse.Clear(); SPHWarehouse.Clear(); foreach (KCT_BuildListVessel b in KCT_GameStates.VABList) { if (b.shipNode == null) { Debug.LogError("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN VABList"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); VABBuildList.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.SPHList) { if (b.shipNode == null) { Debug.LogError("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN SPHList"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); SPHBuildList.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.VABWarehouse) { if (b.shipNode == null) { Debug.LogError("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN VABWarehouse"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); VABWarehouse.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.SPHWarehouse) { if (b.shipNode == null) { Debug.LogError("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN SPHWarehouse"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); SPHWarehouse.Add(bls); } LPRecon = KCT_GameStates.LaunchPadReconditioning; }
public static void reset() { //firstStart = true; PartTracker = new Dictionary <string, int>(); PartInventory = new Dictionary <string, int>(); flightSimulated = false; vesselDict = new Dictionary <string, string>(); simulationBody = KCT_Utilities.GetBodyByName("Kerbin"); simulateInOrbit = false; BodiesVisited = new List <string> { "Kerbin" }; TotalUpgradePoints = 0; VABUpgrades = new List <int>() { 0 }; SPHUpgrades = new List <int>() { 0 }; RDUpgrades = new List <int>() { 0, 0 }; PurchasedUpgrades = new List <int>() { 0, 0 }; LaunchPadReconditioning = null; targetedItem = null; VABList = new List <KCT_BuildListVessel>(); VABWarehouse = new List <KCT_BuildListVessel>(); SPHList = new List <KCT_BuildListVessel>(); SPHWarehouse = new List <KCT_BuildListVessel>(); TechList = new List <KCT_TechItem>(); }