Esempio n. 1
0
        public bool LoadSaveData(AssmeblePartSingleSaveData saveData)
        {
            if (saveData != null)
            {
                InitData(saveData.partID);
                UID            = saveData.UID;
                customDataInfo = new AssemblePartCustomDataInfo();
                customDataInfo.LoadSaveData(saveData);

                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        /// <summary>
        /// Game Save
        /// </summary>
        /// <returns></returns>
        public AssmeblePartSingleSaveData CreatePartSave()
        {
            Dictionary <string, AssmeblePartCustomSaveData> proDic = new Dictionary <string, AssmeblePartCustomSaveData>();

            foreach (var customData in customDataInfo.propertyDic.Values)
            {
                AssmeblePartCustomSaveData saveData = new AssmeblePartCustomSaveData(
                    partID,
                    customData.propertyName,
                    customData.propertyValueMin,
                    customData.propertyValueMax,
                    customData.detailInfoDic,
                    customData.timeCostDetailInfoDic);
                proDic.Add(saveData.propertyName, saveData);
            }
            AssmeblePartSingleSaveData save = new AssmeblePartSingleSaveData(partID, UID, customDataInfo.partNameCustomText, customDataInfo.customValueDic, proDic);

            return(save);
        }
Esempio n. 3
0
        /// <summary>
        /// Game Save
        /// </summary>
        /// <param name="saveData"></param>
        public bool LoadSaveData(AssmeblePartSingleSaveData saveData)
        {
            InitSimpleData(saveData.partID, saveData.customName_Partial);

            Dictionary <string, CustomData> propertyDic = new Dictionary <string, CustomData>();

            foreach (var custom in saveData.propertyDic.Values)
            {
                CustomData customData = new CustomData();
                if (customData.LoadCustomDataSave(custom))
                {
                    propertyDic.Add(customData.propertyName, customData);
                }
                else
                {
                    return(false);
                }
            }
            this.propertyDic    = propertyDic;
            this.customValueDic = saveData.customValueDic;
            return(true);
        }