Exemplo n.º 1
0
        public void writeInventory()
        {
            lock (inventoryLock)
            {
                // Write cargo configuration with current inventory
                CargoMonitorConfiguration configuration = new CargoMonitorConfiguration();

                configuration.cargo        = inventory;
                configuration.cargocarried = cargoCarried;
                configuration.ToFile();
            }
            // Make sure the UI is up to date
            RaiseOnUIThread(InventoryUpdatedEvent, inventory);
        }
Exemplo n.º 2
0
 public void writeInventory()
 {
     lock (inventoryLock)
     {
         // Write cargo configuration with current inventory
         CargoMonitorConfiguration configuration = new CargoMonitorConfiguration();
         cargoCarried = 0;
         foreach (Cargo cargo in inventory)
         {
             cargoCarried += cargo.total;
         }
         EDDI.Instance.eventHandler(new CargoUpdatedEvent(DateTime.UtcNow, cargoCarried));
         configuration.cargo        = inventory;
         configuration.cargocarried = cargoCarried;
         configuration.ToFile();
     }
     // Make sure the UI is up to date
     RaiseOnUIThread(InventoryUpdatedEvent, inventory);
 }