Ejemplo n.º 1
0
 public void AddStatusNode(KolonizationEntry logEntry)
 {
     if (_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex
         && n.VesselId == logEntry.VesselId))
         return;
     _LogInfo.Add(logEntry);
 }
Ejemplo n.º 2
0
        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.ScienceBoosters = logEntry.ScienceBoosters;
            saveEntry.FundsBoosters   = logEntry.FundsBoosters;
            saveEntry.RepBoosters     = logEntry.RepBoosters;
            saveEntry.LastUpdate      = logEntry.LastUpdate;
            saveEntry.KolonyDate      = logEntry.KolonyDate;
        }
Ejemplo n.º 3
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;
            newEntry.Science         = logEntry.Science;
            newEntry.Funds           = logEntry.Funds;
            newEntry.Rep             = logEntry.Rep;
            newEntry.RepBoosters     = logEntry.RepBoosters;
            newEntry.ScienceBoosters = logEntry.ScienceBoosters;
            newEntry.FundsBoosters   = logEntry.FundsBoosters;
            KolonizationScenario.Instance.settings.SaveLogEntryNode(newEntry);
        }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 public void AddStatusNode(KolonizationEntry logEntry)
 {
     if (_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex &&
                      n.VesselId == logEntry.VesselId))
     {
         return;
     }
     _LogInfo.Add(logEntry);
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        public KolonizationEntry FetchLogEntry(string vesselId, int body)
        {
            if (!DoesLogEntryExist(vesselId, body))
            {
                var k = new KolonizationEntry();
                k.VesselId = vesselId;
                k.BodyIndex = body;
                k.LastUpdate = Planetarium.GetUniversalTime();
                k.KolonyDate = Planetarium.GetUniversalTime();
                k.GeologyResearch = 0d;
                k.BotanyResearch = 0d;
                k.KolonizationResearch = 0d;
                k.Science = 0d;
                k.Rep = 0d;
                k.Funds = 0d;
                TrackLogEntry(k);
            }

            var logEntry = KolonizationInfo.FirstOrDefault(n => n.VesselId == vesselId
                && n.BodyIndex == body);
            return logEntry;
        }
Ejemplo n.º 8
0
        public KolonizationEntry FetchLogEntry(string vesselId, int body)
        {
            if (!DoesLogEntryExist(vesselId, body))
            {
                var k = new KolonizationEntry();
                k.VesselId             = vesselId;
                k.BodyIndex            = body;
                k.LastUpdate           = Planetarium.GetUniversalTime();
                k.KolonyDate           = Planetarium.GetUniversalTime();
                k.GeologyResearch      = 0d;
                k.BotanyResearch       = 0d;
                k.KolonizationResearch = 0d;
                k.Science = 0d;
                k.Rep     = 0d;
                k.Funds   = 0d;
                TrackLogEntry(k);
            }

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

            return(logEntry);
        }
Ejemplo n.º 9
0
        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;
        }
Ejemplo n.º 10
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;
     newEntry.Science = logEntry.Science;
     newEntry.Funds = logEntry.Funds;
     newEntry.Rep = logEntry.Rep;
     KolonizationScenario.Instance.settings.SaveLogEntryNode(newEntry);
 }