public UI(TeamService teamService, PlayerService playerService, GameService gameService, ActivePlayerService activePlayerService) { this.teamService = teamService; this.playerService = playerService; this.gameService = gameService; this.activePlayerService = activePlayerService; }
public Controller(TeamService teamService, StudentService studentService, PlayerService playerService, GameService gameService, ActivePlayerService activePlayerService) { this.teamService = teamService; this.studentService = studentService; this.playerService = playerService; this.gameService = gameService; this.activePlayerService = activePlayerService; }
static void Main(string[] args) { TeamRepository teamRepo = new TeamRepository(); PlayerRepository playerRepo = new PlayerRepository(); GameRepository gameRepository = new GameRepository(); ActivePlayerRepository r = new ActivePlayerRepository(); TeamService teamService = new TeamService(new TeamValidator(), teamRepo); PlayerService playerService = new PlayerService(playerRepo, teamRepo, new PlayerValidator()); GameService gameService = new GameService(gameRepository, teamRepo, new GameValidator()); ActivePlayerService activePlayerService = new ActivePlayerService(r, playerRepo, gameRepository); UI ui = new UI(teamService, playerService, gameService, activePlayerService); ui.Run(); }
static void Main(string[] args) { convertFromString <Student> t = toStudent; TestDomains tstDomains = new TestDomains(); TestValidation tstValidation = new TestValidation(); TeamFileRepository repositoryTeamFile = new TeamFileRepository(new ValidationTeam(), @"E:\facultate\NBA League\NBA League\resources\TeamFile.txt"); PlayerFileRepository playerFileRepository = new PlayerFileRepository(new ValidationPlayer(), repositoryTeamFile, @"E:\facultate\NBA League\NBA League\resources\PlayerFile.txt"); StudentFileRepository studentFileRepository = new StudentFileRepository(new ValidationStudent(), @"E:\facultate\NBA League\NBA League\resources\StudentFile.txt"); FileRepository <int, Student> studentml = new FileRepository <int, Student> (new ValidationStudent(), @"E:\facultate\NBA League\NBA League\resources\StudentFile.txt", t); ActivePlayerRepository activePlayerRepository = new ActivePlayerRepository(new ValidationActivePlayer(), @"E:\facultate\NBA League\NBA League\resources\ActivePlayerFile.txt"); GameFileRepository gameFileRepository = new GameFileRepository(new ValidationGame(), repositoryTeamFile, @"E:\facultate\NBA League\NBA League\resources\GameFile.txt"); TeamService teamService = new TeamService(repositoryTeamFile, playerFileRepository, gameFileRepository); StudentService studentService = new StudentService(studentFileRepository); PlayerService playerService = new PlayerService(playerFileRepository, repositoryTeamFile, activePlayerRepository); ActivePlayerService activePlayerService = new ActivePlayerService(activePlayerRepository, playerFileRepository, gameFileRepository); GameService gameService = new GameService(gameFileRepository, repositoryTeamFile, activePlayerRepository); activePlayerService.SaveActivePlayer(2, 4, 32.3, "Rezerva"); Controller controller = new Controller(teamService, studentService, playerService, gameService, activePlayerService); UI ui = new UI(controller); ui.run(); //controller.raportFour(4); //DateTime date1 = new DateTime(2019, 12, // 25, 16, 0, 0); //DateTime date2 = new DateTime(2019, 12, // 25, 16, 55, 0); //controller.raportThree(date1, date2); controller.raportTwo(2, 2); //foreach (ActivePlayer a in activePlayerService.GetAll()) // Console.WriteLine(a); //controller.raportTwo(100, 3); //teamService.DeleteTeam(1); Console.ReadKey(); }