public GameRepository(TeamRepository teamRepo, BetNumberRepository betRepo) { this.teamRepo = teamRepo; this.betRepo = betRepo; if (!Directory.Exists("C:\\temp")) { Directory.CreateDirectory("C:\\temp"); } if (!File.Exists("C:\\temp\\PREMIOS.TXT")) { StreamWriter outStream = File.CreateText("C:\\temp\\PREMIOS.TXT"); outStream.Write(Properties.Resources.PREMIOS); outStream.Close(); } if (!File.Exists("C:\\temp\\RESULTADOS.TXT")) { StreamWriter outStream = File.CreateText("C:\\temp\\RESULTADOS.TXT"); outStream.Write(Properties.Resources.RESULTADOS); outStream.Close(); } this.endpoint = new EndPoint(); }
public GameControl() { this.teamRepo = new TeamRepository(); // Use same betRepo repository for everything // Prevent equality problems. // Prevent large memory usage. this.betRepo = new BetNumberRepository(teamRepo); this.gameRepo = new GameRepository(teamRepo, betRepo); this.game = new Game(); this.gameValidator = new GameValidator(game); }