Beispiel #1
0
        public IVan OrderVan(VanTypes type)
        {
            Logger.Write($"Order placed for {type} van.");

            var van = _factory.CreateVan(type);

            van.PerformValet();
            van.PerformService();
            van.AddFuel();

            Logger.Write($"Order completed with van: {van.ToString()}");

            return(van);
        }
        public IVan CreateVan(VanTypes type)
        {
            Van van;

            // Italians like blue vans right?
            switch (type)
            {
            case VanTypes.Box:
                van = new Van(VanTypes.Luton, 1800, Colours.Blue, 3, 2);
                break;

            case VanTypes.Flatbed:
                van = new Van(VanTypes.Luton, 1800, Colours.Blue, 2, 3);
                break;

            default:
                van = new Van(VanTypes.Luton, 1800, Colours.Blue, 4, 3);
                break;
            }

            // Who needs safety checks?

            return(van);
        }
        public IVan CreateVan(VanTypes type)
        {
            Van van;

            switch (type)
            {
            case VanTypes.Box:
                van = new Van(VanTypes.Luton, 1800, Colours.White, 3, 2);
                break;

            case VanTypes.Flatbed:
                van = new Van(VanTypes.Luton, 1800, Colours.White, 2, 3);
                break;

            default:
                van = new Van(VanTypes.Luton, 1800, Colours.White, 4, 3);
                break;
            }

            PerformSafetyChecks(van);
            PerformCrashTests(van);

            return(van);
        }
Beispiel #4
0
 public Van(VanTypes type, int engineSize, Colours colour, int doors, int seats) : base(engineSize, colour, doors, seats)
 {
     this.Type = type;
 }