Code: Select all
using System;
using UnityEngine;
namespace ES3Types
{
[UnityEngine.Scripting.Preserve]
[ES3PropertiesAttribute("CrewLists", "ShipInventoryInt", "ShipInventory", "BelowDeckInventory", "AboveDeckInventory", "BowInventory", "SternInventory", "AreaInventories", "AreaInventoriesTest", "CannonAmounts", "CurrentCargo", "MaxCargo", "CurrentCrew", "CurrentMaxCrew", "MaxCrew", "CurrentHullHP", "MaxHullHP", "CurrentSailsHP", "MaxSailsHP", "CannonballAmounts", "Draught", "Owner", "MaxCannonsBelowDeck", "MaxCannonsBow", "MaxCannonsStern", "MaxAreaCannons", "StabilityThresholdAboveDeck", "CannonManueverPenalty", "Armor", "ShipName", "ShipType", "ShipRole", "BaseInt", "FleetInInt", "Cannonballs", "MinimumSailingCrew", "MaximumSailingCrew", "MinimumMeleeCrew", "MaximumMeleeCrew", "MinimumCanoneerCrew", "MaximumCanoneerCrew", "MinimumMarksmanCrew", "MaximumMarksmanCrew", "CurrentCannonCrewAmount", "CurrentCannons", "CannonsCrewReq", "ShipPrice", "FleetInt", "CurrentSpeed", "CurrentMaxSpeed", "BaseMaxSpeed", "CurrentManeuver", "CurrentMaxManeuver", "BaseMaxManeuver", "DoChainShots", "DoGrapeShots", "CrewInjured", "CrewKilled", "Status", "Morale", "OfficerCount", "Strategy", "Aggression", "MarkedForCapture", "CannonCrewBoard", "MarksmanCrewBoard", "SailingCrewBoard", "NonMeleeCrewBoarding", "MinimumForCrewToBoard", "MaximumForCrewToBoard", "MedicineStrength", "OfficerLeadership", "OfficerNavalTactics", "OfficerNavigation", "OfficerMedicine", "OfficerCarpentry", "OfficerCooking", "OfficerStats", "AutoTrade", "ItemOrderInt", "StrengthRating", "ExcessCargo", "CannonManeueverPenalty", "ShipID")]
public class ES3UserType_Ship : ES3ObjectType
{
public static ES3Type Instance = null;
public ES3UserType_Ship() : base(typeof(Ship)){ Instance = this; priority = 1; }
protected override void WriteObject(object obj, ES3Writer writer)
{
var instance = (Ship)obj;
writer.WriteProperty("CrewLists", instance.CrewLists);
writer.WriteProperty("ShipInventoryInt", instance.ShipInventoryInt, ES3Type_int.Instance);
writer.WriteProperty("ShipInventory", instance.ShipInventory, ES3Type_Inventory.Instance);
writer.WriteProperty("BelowDeckInventory", instance.BelowDeckInventory, ES3Type_Inventory.Instance);
writer.WriteProperty("AboveDeckInventory", instance.AboveDeckInventory, ES3Type_Inventory.Instance);
writer.WriteProperty("BowInventory", instance.BowInventory, ES3Type_Inventory.Instance);
writer.WriteProperty("SternInventory", instance.SternInventory, ES3Type_Inventory.Instance);
writer.WriteProperty("AreaInventories", instance.AreaInventories);
writer.WriteProperty("AreaInventoriesTest", instance.AreaInventoriesTest);
writer.WriteProperty("CannonAmounts", instance.CannonAmounts);
writer.WriteProperty("CurrentCargo", instance.CurrentCargo, ES3Type_float.Instance);
writer.WriteProperty("MaxCargo", instance.MaxCargo, ES3Type_float.Instance);
writer.WriteProperty("CurrentCrew", instance.CurrentCrew, ES3Type_int.Instance);
writer.WriteProperty("CurrentMaxCrew", instance.CurrentMaxCrew, ES3Type_int.Instance);
writer.WriteProperty("MaxCrew", instance.MaxCrew, ES3Type_int.Instance);
writer.WriteProperty("CurrentHullHP", instance.CurrentHullHP, ES3Type_float.Instance);
writer.WriteProperty("MaxHullHP", instance.MaxHullHP, ES3Type_float.Instance);
writer.WriteProperty("CurrentSailsHP", instance.CurrentSailsHP, ES3Type_float.Instance);
writer.WriteProperty("MaxSailsHP", instance.MaxSailsHP, ES3Type_float.Instance);
writer.WriteProperty("CannonballAmounts", instance.CannonballAmounts);
writer.WriteProperty("Draught", instance.Draught, ES3Type_string.Instance);
writer.WriteProperty("Owner", instance.Owner, ES3Type_string.Instance);
writer.WriteProperty("MaxCannonsBelowDeck", instance.MaxCannonsBelowDeck, ES3Type_int.Instance);
writer.WriteProperty("MaxCannonsBow", instance.MaxCannonsBow, ES3Type_int.Instance);
writer.WriteProperty("MaxCannonsStern", instance.MaxCannonsStern, ES3Type_int.Instance);
writer.WriteProperty("MaxAreaCannons", instance.MaxAreaCannons);
writer.WriteProperty("StabilityThresholdAboveDeck", instance.StabilityThresholdAboveDeck, ES3Type_int.Instance);
writer.WriteProperty("CannonManueverPenalty", instance.CannonManueverPenalty, ES3Type_float.Instance);
writer.WriteProperty("Armor", instance.Armor, ES3Type_float.Instance);
writer.WriteProperty("ShipName", instance.ShipName, ES3Type_string.Instance);
writer.WriteProperty("ShipType", instance.ShipType, ES3Type_string.Instance);
writer.WriteProperty("ShipRole", instance.ShipRole, ES3Type_string.Instance);
writer.WriteProperty("BaseInt", instance.BaseInt, ES3Type_int.Instance);
writer.WriteProperty("FleetInInt", instance.FleetInInt, ES3Type_int.Instance);
writer.WriteProperty("Cannonballs", instance.Cannonballs);
writer.WriteProperty("MinimumSailingCrew", instance.MinimumSailingCrew, ES3Type_int.Instance);
writer.WriteProperty("MaximumSailingCrew", instance.MaximumSailingCrew, ES3Type_int.Instance);
writer.WriteProperty("MinimumMeleeCrew", instance.MinimumMeleeCrew, ES3Type_int.Instance);
writer.WriteProperty("MaximumMeleeCrew", instance.MaximumMeleeCrew, ES3Type_int.Instance);
writer.WriteProperty("MinimumCanoneerCrew", instance.MinimumCanoneerCrew, ES3Type_int.Instance);
writer.WriteProperty("MaximumCanoneerCrew", instance.MaximumCanoneerCrew, ES3Type_int.Instance);
writer.WriteProperty("MinimumMarksmanCrew", instance.MinimumMarksmanCrew, ES3Type_int.Instance);
writer.WriteProperty("MaximumMarksmanCrew", instance.MaximumMarksmanCrew, ES3Type_int.Instance);
writer.WriteProperty("CurrentCannonCrewAmount", instance.CurrentCannonCrewAmount, ES3Type_int.Instance);
writer.WriteProperty("CurrentCannons", instance.CurrentCannons, ES3Type_int.Instance);
writer.WriteProperty("CannonsCrewReq", instance.CannonsCrewReq, ES3Type_int.Instance);
writer.WriteProperty("ShipPrice", instance.ShipPrice, ES3Type_float.Instance);
writer.WriteProperty("FleetInt", instance.FleetInt, ES3Type_int.Instance);
writer.WriteProperty("CurrentSpeed", instance.CurrentSpeed, ES3Type_float.Instance);
writer.WriteProperty("CurrentMaxSpeed", instance.CurrentMaxSpeed, ES3Type_float.Instance);
writer.WriteProperty("BaseMaxSpeed", instance.BaseMaxSpeed, ES3Type_float.Instance);
writer.WriteProperty("CurrentManeuver", instance.CurrentManeuver, ES3Type_float.Instance);
writer.WriteProperty("CurrentMaxManeuver", instance.CurrentMaxManeuver, ES3Type_float.Instance);
writer.WriteProperty("BaseMaxManeuver", instance.BaseMaxManeuver, ES3Type_float.Instance);
writer.WriteProperty("DoChainShots", instance.DoChainShots, ES3Type_bool.Instance);
writer.WriteProperty("DoGrapeShots", instance.DoGrapeShots, ES3Type_bool.Instance);
writer.WriteProperty("CrewInjured", instance.CrewInjured, ES3Type_int.Instance);
writer.WriteProperty("CrewKilled", instance.CrewKilled, ES3Type_int.Instance);
writer.WriteProperty("Status", instance.Status, ES3Type_string.Instance);
writer.WriteProperty("Morale", instance.Morale, ES3Type_float.Instance);
writer.WriteProperty("OfficerCount", instance.OfficerCount, ES3Type_int.Instance);
writer.WriteProperty("Strategy", instance.Strategy, ES3Type_string.Instance);
writer.WriteProperty("Aggression", instance.Aggression, ES3Type_int.Instance);
writer.WriteProperty("MarkedForCapture", instance.MarkedForCapture, ES3Type_bool.Instance);
writer.WriteProperty("CannonCrewBoard", instance.CannonCrewBoard, ES3Type_bool.Instance);
writer.WriteProperty("MarksmanCrewBoard", instance.MarksmanCrewBoard, ES3Type_bool.Instance);
writer.WriteProperty("SailingCrewBoard", instance.SailingCrewBoard, ES3Type_bool.Instance);
writer.WriteProperty("NonMeleeCrewBoarding", instance.NonMeleeCrewBoarding);
writer.WriteProperty("MinimumForCrewToBoard", instance.MinimumForCrewToBoard);
writer.WriteProperty("MaximumForCrewToBoard", instance.MaximumForCrewToBoard);
writer.WriteProperty("MedicineStrength", instance.MedicineStrength, ES3Type_float.Instance);
writer.WriteProperty("OfficerLeadership", instance.OfficerLeadership, ES3Type_float.Instance);
writer.WriteProperty("OfficerNavalTactics", instance.OfficerNavalTactics, ES3Type_float.Instance);
writer.WriteProperty("OfficerNavigation", instance.OfficerNavigation, ES3Type_float.Instance);
writer.WriteProperty("OfficerMedicine", instance.OfficerMedicine, ES3Type_float.Instance);
writer.WriteProperty("OfficerCarpentry", instance.OfficerCarpentry, ES3Type_float.Instance);
writer.WriteProperty("OfficerCooking", instance.OfficerCooking, ES3Type_float.Instance);
writer.WriteProperty("OfficerStats", instance.OfficerStats);
writer.WriteProperty("AutoTrade", instance.AutoTrade, ES3Type_bool.Instance);
writer.WriteProperty("ItemOrderInt", instance.ItemOrderInt, ES3Type_int.Instance);
writer.WriteProperty("StrengthRating", instance.StrengthRating, ES3Type_float.Instance);
writer.WriteProperty("ExcessCargo", instance.ExcessCargo, ES3Type_float.Instance);
writer.WriteProperty("CannonManeueverPenalty", instance.CannonManeueverPenalty, ES3Type_float.Instance);
writer.WriteProperty("ShipID", instance.ShipID, ES3Type_int.Instance);
}
protected override void ReadObject<T>(ES3Reader reader, object obj)
{
var instance = (Ship)obj;
foreach(string propertyName in reader.Properties)
{
switch(propertyName)
{
case "CrewLists":
instance.CrewLists = reader.Read<System.Collections.Generic.List<System.Collections.Generic.List<Crew>>>();
break;
case "ShipInventoryInt":
instance.ShipInventoryInt = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "ShipInventory":
instance.ShipInventory = reader.Read<Inventory>(ES3Type_Inventory.Instance);
break;
case "BelowDeckInventory":
instance.BelowDeckInventory = reader.Read<Inventory>(ES3Type_Inventory.Instance);
break;
case "AboveDeckInventory":
instance.AboveDeckInventory = reader.Read<Inventory>(ES3Type_Inventory.Instance);
break;
case "BowInventory":
instance.BowInventory = reader.Read<Inventory>(ES3Type_Inventory.Instance);
break;
case "SternInventory":
instance.SternInventory = reader.Read<Inventory>(ES3Type_Inventory.Instance);
break;
case "AreaInventories":
instance.AreaInventories = reader.Read<System.Collections.Generic.List<Inventory>>();
break;
case "AreaInventoriesTest":
instance.AreaInventoriesTest = reader.Read<System.Collections.Generic.List<System.Collections.Generic.List<InventoryItem>>>();
break;
case "CannonAmounts":
instance.CannonAmounts = reader.Read<System.Collections.Generic.List<System.Int32>>();
break;
case "CurrentCargo":
instance.CurrentCargo = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "MaxCargo":
instance.MaxCargo = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "CurrentCrew":
instance.CurrentCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "CurrentMaxCrew":
instance.CurrentMaxCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MaxCrew":
instance.MaxCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "CurrentHullHP":
instance.CurrentHullHP = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "MaxHullHP":
instance.MaxHullHP = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "CurrentSailsHP":
instance.CurrentSailsHP = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "MaxSailsHP":
instance.MaxSailsHP = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "CannonballAmounts":
instance.CannonballAmounts = reader.Read<System.Collections.Generic.List<System.Int32>>();
break;
case "Draught":
instance.Draught = reader.Read<System.String>(ES3Type_string.Instance);
break;
case "Owner":
instance.Owner = reader.Read<System.String>(ES3Type_string.Instance);
break;
case "MaxCannonsBelowDeck":
instance.MaxCannonsBelowDeck = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MaxCannonsBow":
instance.MaxCannonsBow = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MaxCannonsStern":
instance.MaxCannonsStern = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MaxAreaCannons":
instance.MaxAreaCannons = reader.Read<System.Collections.Generic.List<System.Int32>>();
break;
case "StabilityThresholdAboveDeck":
instance.StabilityThresholdAboveDeck = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "CannonManueverPenalty":
instance.CannonManueverPenalty = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "Armor":
instance.Armor = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "ShipName":
instance.ShipName = reader.Read<System.String>(ES3Type_string.Instance);
break;
case "ShipType":
instance.ShipType = reader.Read<System.String>(ES3Type_string.Instance);
break;
case "ShipRole":
instance.ShipRole = reader.Read<System.String>(ES3Type_string.Instance);
break;
case "BaseInt":
instance.BaseInt = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "FleetInInt":
instance.FleetInInt = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "Cannonballs":
instance.Cannonballs = reader.Read<System.Collections.Generic.List<InventoryItem>>();
break;
case "MinimumSailingCrew":
instance.MinimumSailingCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MaximumSailingCrew":
instance.MaximumSailingCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MinimumMeleeCrew":
instance.MinimumMeleeCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MaximumMeleeCrew":
instance.MaximumMeleeCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MinimumCanoneerCrew":
instance.MinimumCanoneerCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MaximumCanoneerCrew":
instance.MaximumCanoneerCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MinimumMarksmanCrew":
instance.MinimumMarksmanCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MaximumMarksmanCrew":
instance.MaximumMarksmanCrew = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "CurrentCannonCrewAmount":
instance.CurrentCannonCrewAmount = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "CurrentCannons":
instance.CurrentCannons = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "CannonsCrewReq":
instance.CannonsCrewReq = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "ShipPrice":
instance.ShipPrice = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "FleetInt":
instance.FleetInt = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "CurrentSpeed":
instance.CurrentSpeed = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "CurrentMaxSpeed":
instance.CurrentMaxSpeed = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "BaseMaxSpeed":
instance.BaseMaxSpeed = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "CurrentManeuver":
instance.CurrentManeuver = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "CurrentMaxManeuver":
instance.CurrentMaxManeuver = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "BaseMaxManeuver":
instance.BaseMaxManeuver = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "DoChainShots":
instance.DoChainShots = reader.Read<System.Boolean>(ES3Type_bool.Instance);
break;
case "DoGrapeShots":
instance.DoGrapeShots = reader.Read<System.Boolean>(ES3Type_bool.Instance);
break;
case "CrewInjured":
instance.CrewInjured = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "CrewKilled":
instance.CrewKilled = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "Status":
instance.Status = reader.Read<System.String>(ES3Type_string.Instance);
break;
case "Morale":
instance.Morale = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "OfficerCount":
instance.OfficerCount = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "Strategy":
instance.Strategy = reader.Read<System.String>(ES3Type_string.Instance);
break;
case "Aggression":
instance.Aggression = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "MarkedForCapture":
instance.MarkedForCapture = reader.Read<System.Boolean>(ES3Type_bool.Instance);
break;
case "CannonCrewBoard":
instance.CannonCrewBoard = reader.Read<System.Boolean>(ES3Type_bool.Instance);
break;
case "MarksmanCrewBoard":
instance.MarksmanCrewBoard = reader.Read<System.Boolean>(ES3Type_bool.Instance);
break;
case "SailingCrewBoard":
instance.SailingCrewBoard = reader.Read<System.Boolean>(ES3Type_bool.Instance);
break;
case "NonMeleeCrewBoarding":
instance.NonMeleeCrewBoarding = reader.Read<System.Collections.Generic.List<System.Boolean>>();
break;
case "MinimumForCrewToBoard":
instance.MinimumForCrewToBoard = reader.Read<System.Collections.Generic.List<System.Single>>();
break;
case "MaximumForCrewToBoard":
instance.MaximumForCrewToBoard = reader.Read<System.Collections.Generic.List<System.Single>>();
break;
case "MedicineStrength":
instance.MedicineStrength = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "OfficerLeadership":
instance.OfficerLeadership = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "OfficerNavalTactics":
instance.OfficerNavalTactics = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "OfficerNavigation":
instance.OfficerNavigation = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "OfficerMedicine":
instance.OfficerMedicine = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "OfficerCarpentry":
instance.OfficerCarpentry = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "OfficerCooking":
instance.OfficerCooking = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "OfficerStats":
instance.OfficerStats = reader.Read<System.Collections.Generic.List<System.Single>>();
break;
case "AutoTrade":
instance.AutoTrade = reader.Read<System.Boolean>(ES3Type_bool.Instance);
break;
case "ItemOrderInt":
instance.ItemOrderInt = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
case "StrengthRating":
instance.StrengthRating = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "ExcessCargo":
instance.ExcessCargo = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "CannonManeueverPenalty":
instance.CannonManeueverPenalty = reader.Read<System.Single>(ES3Type_float.Instance);
break;
case "ShipID":
instance.ShipID = reader.Read<System.Int32>(ES3Type_int.Instance);
break;
default:
reader.Skip();
break;
}
}
}
protected override object ReadObject<T>(ES3Reader reader)
{
var instance = new Ship();
ReadObject<T>(reader, instance);
return instance;
}
}
public class ES3UserType_ShipArray : ES3ArrayType
{
public static ES3Type Instance;
public ES3UserType_ShipArray() : base(typeof(Ship[]), ES3UserType_Ship.Instance)
{
Instance = this;
}
}
}
Here's the code where I reconstruct the lists (like I mentioned, I've tried both having all lists saved in the ES3 type and not, doesn't make a difference