Ejemplo n.º 1
0
        public static void Main()
        {
            var raceRepo       = new RaceRepository();
            var riderRepo      = new RiderRepository();
            var motorcycleRepo = new MotorcycleRepository();

            var raceFactory       = new RaceFactory();
            var riderFactory      = new RiderFactory();
            var motorcycleFactory = new MotorcycleFactory();

            var championshipController = new ChampionshipController(
                raceRepo,
                riderRepo,
                motorcycleRepo,
                raceFactory,
                riderFactory,
                motorcycleFactory);

            var consoleReader = new ConsoleReader();
            var consoleWriter = new ConsoleWriter();

            var engine = new Engine(
                championshipController,
                consoleReader,
                consoleWriter);

            engine.Run();
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            //TODO Add IEngine
            //Motorcycle varche = new PowerMotorcycle("12214235", 75);
            //Console.WriteLine(varche.HorsePower);
            IMotorcycleFactory motorcycleFactory = new MotorcycleFactory();
            IRaceFactory       raceFactory       = new RaceFactory();
            IRiderFactory      riderFactory      = new RiderFactory();

            MotorcycleRepository motorcycleRepository = new MotorcycleRepository();
            RaceRepository       raceRepository       = new RaceRepository();
            RiderRepository      riderRepository      = new RiderRepository();

            IChampionshipController controller = new ChampionshipController(
                motorcycleFactory,
                raceFactory,
                riderFactory,
                motorcycleRepository,
                raceRepository,
                riderRepository);

            IReader reader = new ConsoleReader();
            IWriter writer = new ConsoleWriter();

            IEngine engine = new Engine(reader, writer, controller);

            engine.Run();
        }