Exemple #1
0
 /// <summary>
 /// Register a power supply from a generator connected to the powernet
 /// </summary>
 public void AddPowerStorage(PowerStorageNetComponent storage)
 {
     if (storage.ChargePowernet)
     {
         PowerStorageSupplierList.Add(storage);
     }
     else
     {
         PowerStorageConsumerList.Add(storage);
     }
 }
Exemple #2
0
        /// <summary>
        /// Remove a power supply from a generator connected to the powernet
        /// </summary>
        public void RemovePowerStorage(PowerStorageNetComponent storage)
        {
            if (PowerStorageSupplierList.Contains(storage))
            {
                PowerStorageSupplierList.Remove(storage);
            }

            if (PowerStorageConsumerList.Contains(storage))
            {
                PowerStorageSupplierList.Remove(storage);
            }
        }
Exemple #3
0
        //How do I even call this? TODO: fix
        public void UpdateStorageType(PowerStorageNetComponent storage)
        {
            //If our chargepowernet settings change we need to tell the powernet of this new setting and remove traces of our old setting
            if (PowerStorageSupplierList.Contains(storage))
            {
                PowerStorageSupplierList.Remove(storage);
            }
            if (PowerStorageConsumerList.Contains(storage))
            {
                PowerStorageConsumerList.Remove(storage);
            }

            //Apply new setting
            if (storage.ChargePowernet)
            {
                PowerStorageSupplierList.Add(storage);
            }
            else
            {
                PowerStorageConsumerList.Add(storage);
            }
        }