Пример #1
0
 public void AddStatusNode(PlanetaryLogisticsEntry logEntry)
 {
     if (_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex &&
                      n.ResourceName == logEntry.ResourceName))
     {
         return;
     }
     _LogInfo.Add(logEntry);
 }
Пример #2
0
        public void DeleteStatusNode(PlanetaryLogisticsEntry logEntry)
        {
            if (!_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex &&
                              n.ResourceName == logEntry.ResourceName))
            {
                return;
            }
            var l = _LogInfo.First(n => n.BodyIndex == logEntry.BodyIndex &&
                                   n.ResourceName == logEntry.ResourceName);

            _LogInfo.Remove(l);
        }
        public PlanetaryLogisticsEntry FetchLogEntry(string ResourceName, int body)
        {
            if (!DoesLogEntryExist(ResourceName, body))
            {
                var k = new PlanetaryLogisticsEntry();
                k.ResourceName = ResourceName;
                k.BodyIndex = body;
                k.StoredQuantity = 0d;
                TrackLogEntry(k);
            }

            var logEntry = PlanetaryLogisticsInfo.FirstOrDefault(n => n.ResourceName == ResourceName
                && n.BodyIndex == body);
            return logEntry;
        }
 public void TrackLogEntry(PlanetaryLogisticsEntry logEntry)
 {
     PlanetaryLogisticsEntry newEntry =
         PlanetaryLogisticsInfo.FirstOrDefault(n => n.ResourceName == logEntry.ResourceName
         && n.BodyIndex == logEntry.BodyIndex);
     if (newEntry == null)
     {
         newEntry = new PlanetaryLogisticsEntry();
         newEntry.ResourceName = logEntry.ResourceName;
         newEntry.BodyIndex = logEntry.BodyIndex;
         PlanetaryLogisticsInfo.Add(newEntry);
     }
     newEntry.StoredQuantity = logEntry.StoredQuantity;
     PlanetaryLogisticsScenario.Instance.settings.SaveLogEntryNode(logEntry);
 }
        public void SaveLogEntryNode(PlanetaryLogisticsEntry logEntry)
        {
            PlanetaryLogisticsEntry saveEntry =
                _LogInfo.FirstOrDefault(n => n.BodyIndex == logEntry.BodyIndex &&
                                        n.ResourceName == logEntry.ResourceName);

            if (saveEntry == null)
            {
                saveEntry = new PlanetaryLogisticsEntry();
                saveEntry.ResourceName = logEntry.ResourceName;
                saveEntry.BodyIndex    = logEntry.BodyIndex;
                _LogInfo.Add(saveEntry);
            }
            saveEntry.StoredQuantity = logEntry.StoredQuantity;
        }
        public PlanetaryLogisticsEntry FetchLogEntry(string ResourceName, int body)
        {
            if (!DoesLogEntryExist(ResourceName, body))
            {
                var k = new PlanetaryLogisticsEntry();
                k.ResourceName   = ResourceName;
                k.BodyIndex      = body;
                k.StoredQuantity = 0d;
                TrackLogEntry(k);
            }

            var logEntry = PlanetaryLogisticsInfo.FirstOrDefault(n => n.ResourceName == ResourceName &&
                                                                 n.BodyIndex == body);

            return(logEntry);
        }
Пример #7
0
        public void TrackLogEntry(PlanetaryLogisticsEntry logEntry)
        {
            PlanetaryLogisticsEntry newEntry =
                PlanetaryLogisticsInfo.FirstOrDefault(n => n.ResourceName == logEntry.ResourceName &&
                                                      n.BodyIndex == logEntry.BodyIndex);

            if (newEntry == null)
            {
                newEntry = new PlanetaryLogisticsEntry();
                newEntry.ResourceName = logEntry.ResourceName;
                newEntry.BodyIndex    = logEntry.BodyIndex;
                PlanetaryLogisticsInfo.Add(newEntry);
            }
            newEntry.StoredQuantity = logEntry.StoredQuantity;
            PlanetaryLogisticsScenario.Instance.settings.SaveLogEntryNode(logEntry);
        }
        public void SaveLogEntryNode(PlanetaryLogisticsEntry logEntry)
        {
            PlanetaryLogisticsEntry saveEntry =
                _LogInfo.FirstOrDefault(n => n.BodyIndex == logEntry.BodyIndex
                && n.ResourceName == logEntry.ResourceName);

            if (saveEntry == null)
            {
                saveEntry = new PlanetaryLogisticsEntry();
                saveEntry.ResourceName = logEntry.ResourceName;
                saveEntry.BodyIndex = logEntry.BodyIndex;

                _LogInfo.Add(saveEntry);
            }
            saveEntry.StoredQuantity = logEntry.StoredQuantity;
        }
 public void DeleteStatusNode(PlanetaryLogisticsEntry logEntry)
 {
     if (!_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex
         && n.ResourceName == logEntry.ResourceName))
         return;
     var l = _LogInfo.First(n => n.BodyIndex == logEntry.BodyIndex
         && n.ResourceName == logEntry.ResourceName);
     _LogInfo.Remove(l);
 }
 public void AddStatusNode(PlanetaryLogisticsEntry logEntry)
 {
     if (_LogInfo.Any(n => n.BodyIndex == logEntry.BodyIndex
         && n.ResourceName == logEntry.ResourceName))
         return;
     _LogInfo.Add(logEntry);
 }