public void AddStatusNode(KolonizationEntry logEntry)
 {
     if (_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex &&
                      n.VesselId == logEntry.VesselId))
     {
         return;
     }
     _LogInfo.Add(logEntry);
 }
        public void DeleteStatusNode(KolonizationEntry logEntry)
        {
            if (!_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex &&
                              n.VesselId == logEntry.VesselId))
            {
                return;
            }
            var l = _LogInfo.First(n => n.BodyIndex == logEntry.BodyIndex &&
                                   n.VesselId == logEntry.VesselId);

            _LogInfo.Remove(l);
        }
        public void SaveLogEntryNode(KolonizationEntry logEntry)
        {
            KolonizationEntry saveEntry =
                _LogInfo.FirstOrDefault(n => n.BodyIndex == logEntry.BodyIndex &&
                                        n.VesselId == logEntry.VesselId);

            if (saveEntry == null)
            {
                saveEntry           = new KolonizationEntry();
                saveEntry.VesselId  = logEntry.VesselId;
                saveEntry.BodyIndex = logEntry.BodyIndex;

                _LogInfo.Add(saveEntry);
            }
            saveEntry.BotanyResearch       = logEntry.BotanyResearch;
            saveEntry.GeologyResearch      = logEntry.GeologyResearch;
            saveEntry.KolonizationResearch = logEntry.KolonizationResearch;
            saveEntry.LastUpdate           = logEntry.LastUpdate;
            saveEntry.KolonyDate           = logEntry.KolonyDate;
        }
Esempio n. 4
0
        public void TrackLogEntry(KolonizationEntry logEntry)
        {
            KolonizationEntry newEntry =
                KolonizationInfo.FirstOrDefault(n => n.VesselId == logEntry.VesselId &&
                                                n.BodyIndex == logEntry.BodyIndex);

            if (newEntry == null)
            {
                newEntry           = new KolonizationEntry();
                newEntry.VesselId  = logEntry.VesselId;
                newEntry.BodyIndex = logEntry.BodyIndex;
                KolonizationInfo.Add(newEntry);
            }
            newEntry.LastUpdate           = logEntry.LastUpdate;
            newEntry.KolonyDate           = logEntry.KolonyDate;
            newEntry.GeologyResearch      = logEntry.GeologyResearch;
            newEntry.BotanyResearch       = logEntry.BotanyResearch;
            newEntry.KolonizationResearch = logEntry.KolonizationResearch;
            KolonizationScenario.Instance.settings.SaveLogEntryNode(newEntry);
        }
Esempio n. 5
0
        public KolonizationEntry FetchLogEntry(string resource, int body)
        {
            if (!DoesLogEntryExist(resource, body))
            {
                var k = new KolonizationEntry();
                k.VesselId             = resource;
                k.BodyIndex            = body;
                k.LastUpdate           = Planetarium.GetUniversalTime();
                k.KolonyDate           = Planetarium.GetUniversalTime();
                k.GeologyResearch      = 0d;
                k.BotanyResearch       = 0d;
                k.KolonizationResearch = 0d;
                TrackLogEntry(k);
            }

            var logEntry = KolonizationInfo.FirstOrDefault(n => n.VesselId == resource &&
                                                           n.BodyIndex == body);

            return(logEntry);
        }
        public void SaveLogEntryNode(KolonizationEntry logEntry)
        {
            KolonizationEntry saveEntry =
                _LogInfo.FirstOrDefault(n => n.BodyIndex == logEntry.BodyIndex
                && n.VesselId == logEntry.VesselId);

            if (saveEntry == null)
            {
                saveEntry = new KolonizationEntry();
                saveEntry.VesselId = logEntry.VesselId;
                saveEntry.BodyIndex = logEntry.BodyIndex;

                _LogInfo.Add(saveEntry);
            }
            saveEntry.BotanyResearch = logEntry.BotanyResearch;
            saveEntry.GeologyResearch = logEntry.GeologyResearch;
            saveEntry.KolonizationResearch = logEntry.KolonizationResearch;
            saveEntry.Science = logEntry.Science;
            saveEntry.Funds = logEntry.Funds;
            saveEntry.Rep = logEntry.Rep;
            saveEntry.LastUpdate = logEntry.LastUpdate;
            saveEntry.KolonyDate = logEntry.KolonyDate;
        }
 public void DeleteStatusNode(KolonizationEntry logEntry)
 {
     if (!_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex
         && n.VesselId == logEntry.VesselId))
         return;
     var l = _LogInfo.First(n => n.BodyIndex == logEntry.BodyIndex
         && n.VesselId == logEntry.VesselId);
     _LogInfo.Remove(l);
 }
 public void AddStatusNode(KolonizationEntry logEntry)
 {
     if (_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex
         && n.VesselId == logEntry.VesselId))
         return;
     _LogInfo.Add(logEntry);
 }