Exemple #1
0
 private void handleCommodityRefinedEvent(CommodityRefinedEvent @event)
 {
     if (@event.timestamp > updateDat)
     {
         updateDat = @event.timestamp;
         if (_handleCommodityRefinedEvent(@event))
         {
             writeInventory();
         }
     }
 }
Exemple #2
0
        public void _handleCommodityRefinedEvent(CommodityRefinedEvent @event)
        {
            Cargo cargo = GetCargoWithEDName(@event.commodityDefinition?.edname);

            if (cargo != null)
            {
                cargo.owned++;
                cargo.CalculateNeed();
            }
            else
            {
                Cargo newCargo = new Cargo(@event.commodityDefinition?.edname, 1);
                newCargo.haulage = 0;
                newCargo.stolen  = 0;
                newCargo.owned   = 1;
                AddCargo(newCargo);
            }
        }
Exemple #3
0
        private bool _handleCommodityRefinedEvent(CommodityRefinedEvent @event)
        {
            bool  update = false;
            Cargo cargo  = GetCargoWithEDName(@event.commodityDefinition?.edname);

            if (cargo != null)
            {
                Haulage haulage = cargo.haulageData.FirstOrDefault(h => h.typeEDName
                                                                   .ToLowerInvariant()
                                                                   .Contains("mining"));
                if (haulage != null)
                {
                    haulage.sourcesystem = EDDI.Instance?.CurrentStarSystem?.systemname;
                    haulage.sourcebody   = EDDI.Instance?.CurrentStation?.name;
                    update = true;
                }
            }
            return(update);
        }
Exemple #4
0
 private void handleCommodityRefinedEvent(CommodityRefinedEvent @event)
 {
     _handleCommodityRefinedEvent(@event);
     writeInventory();
 }