public bool LoadSaveData(AssembleShipSingleSaveData saveData) { if (saveData != null) { InitData(saveData.shipID); customData = new AssembleShipCustomData(saveData); return(true); } return(false); }
public AssembleShipSingleSaveData CreateSaveData() { List <int> partIDList = new List <int>(); foreach (var part in customData.customPartData.Keys) { partIDList.Add(part); } AssembleShipSingleSaveData save = new AssembleShipSingleSaveData(warShipID, UID, customData.customNameText, partIDList); return(save); }
public AssembleShipCustomData(AssembleShipSingleSaveData saveData) { if (saveData != null) { this.WarshipID = saveData.shipID; this.customNameText = saveData.customName_Partial; Dictionary <int, AssemblePartInfo> infoDic = new Dictionary <int, AssemblePartInfo>(); for (int i = 0; i < saveData.customPartData.Count; i++) { var partInfo = PlayerManager.Instance.GetAssemblePartDesignInfo((ushort)saveData.customPartData[i]); if (partInfo != null) { infoDic.Add(partInfo.UID, partInfo); } } customPartData = infoDic; } }