Esempio n. 1
0
        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())));
        }
Esempio n. 2
0
 public RecursingFuelCalculator(IFuelCalculator calculator)
 {
     this.calculator = calculator;
 }
Esempio n. 3
0
 public Component(IFuelCalculator fuelCalculator, int mass)
 {
     this.fuelCalculator = fuelCalculator;
     Mass = mass;
 }
Esempio n. 4
0
 public Rocket(IFuelCalculator fuelCalculator)
 {
     _fuelCalculator = fuelCalculator;
     _rocketModules  = new List <IRocketModule>();
 }
Esempio n. 5
0
 public SimpleFuelCalculator(IFuelCalculator additionalCalculator = null)
 {
     _additionalCalculator = additionalCalculator;
 }
Esempio n. 6
0
 public RecursiveFuelCalculator(IFuelCalculator additionalCalculator)
 {
     _additionalCalculator = additionalCalculator;
 }