Пример #1
0
        internal ConfigNode EncodeToCN()
        {
            KACAlarmListStorage lstTemp = new KACAlarmListStorage();

            lstTemp.list = this;
            //MonoBehaviourExtended.LogFormatted("{0}", lstTemp.list.Count);
            //foreach (KACAlarm item in lstTemp.list)
            //{
            //    MonoBehaviourExtended.LogFormatted("{0}", item.AsConfigNode);
            //}
            ConfigNode cnReturn = lstTemp.AsConfigNode;

            MonoBehaviourExtended.LogFormatted_DebugOnly("Encoding:{0}", cnReturn);
            //MonoBehaviourExtended.LogFormatted("{0}", cnReturn.GetNode("list"));
            return(cnReturn);
        }
Пример #2
0
 internal void DecodeFromCN(ConfigNode AlarmListNode)
 {
     try
     {
         if (AlarmListNode.CountNodes < 1)
         {
             Log.detail("No Alarms to Load");
         }
         else
         {
             Log.dbg("Decoding:{0}", AlarmListNode);
             KACAlarmListStorage lstTemp = new KACAlarmListStorage();
             ConfigNode.LoadObjectFromConfig(lstTemp, AlarmListNode);
             //this.Clear();
             this.AddRange(lstTemp.list);
         }
     }
     catch (Exception ex)
     {
         Log.error(ex, "Failed to Load Alarms from Save File! AlarmListNode: {0}", AlarmListNode);
     }
 }
Пример #3
0
 internal void DecodeFromCN(ConfigNode AlarmListNode)
 {
     try
     {
         if (AlarmListNode.CountNodes < 1)
         {
             MonoBehaviourExtended.LogFormatted("No Alarms to Load");
         }
         else
         {
             MonoBehaviourExtended.LogFormatted_DebugOnly("Decoding:{0}", AlarmListNode);
             KACAlarmListStorage lstTemp = new KACAlarmListStorage();
             ConfigNode.LoadObjectFromConfig(lstTemp, AlarmListNode);
             //this.Clear();
             this.AddRange(lstTemp.list);
         }
     }
     catch (Exception ex)
     {
         MonoBehaviourExtended.LogFormatted("Failed to Load Alarms from Save File");
         MonoBehaviourExtended.LogFormatted("Message: {0}", ex.Message);
         MonoBehaviourExtended.LogFormatted("AlarmListNode: {0}", AlarmListNode);
     }
 }