public void Apply(Simulation sim, ResourceCollection resources) { if (resources.CanApplyNextCycle(OperatingCost)) { resources.ApplyNextCycle(OperatingCost); resources.GetResource(ResourceType.Deflection).ChangeNextCycle += sim.MaxTime - sim.CurrentTime; } }
public void Apply(Simulation sim, ResourceCollection resources) { // Don't convert if some input is not present in sufficient quantity. if (!Effects.All(resources.CanApplyNextCycle)) { return; } foreach (ResourceDelta effect in Effects) { resources.ApplyNextCycle(effect); } }