public ComponentList(string fileName, IFuelCalculator fuelCalculator) { //Not abstracting out IO because I've over engineered this enough. var componentMasses = File.ReadAllText(fileName); components = componentMasses .Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries) .Select(x => new Component(fuelCalculator, int.Parse(x.Trim()))); }
public RecursingFuelCalculator(IFuelCalculator calculator) { this.calculator = calculator; }
public Component(IFuelCalculator fuelCalculator, int mass) { this.fuelCalculator = fuelCalculator; Mass = mass; }
public Rocket(IFuelCalculator fuelCalculator) { _fuelCalculator = fuelCalculator; _rocketModules = new List <IRocketModule>(); }
public SimpleFuelCalculator(IFuelCalculator additionalCalculator = null) { _additionalCalculator = additionalCalculator; }
public RecursiveFuelCalculator(IFuelCalculator additionalCalculator) { _additionalCalculator = additionalCalculator; }