/// <summary> /// Remove a power supply from a generator connected to the powernet /// </summary> public void RemovePowerStorage(PowerStorageComponent storage) { if (PowerStorageSupplierlist.Contains(storage)) { PowerStorageSupplierlist.Remove(storage); } if (PowerStorageConsumerlist.Contains(storage)) { PowerStorageSupplierlist.Remove(storage); } }
//How do I even call this? TODO: fix public void UpdateStorageType(PowerStorageComponent 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); } }