public override Core.Game CreateGame(Container container, BoardView boardView, Color color, GameCreatorParameters parameters) { IEngine engine = new RealEngine(container); Core.Game game; // Si le joueur local est blanc if (color == Color.White) { PlayerControler whitePlayerControler = new BoardViewPlayerController(boardView); PlayerControler blackPlayerControler = new NetworkPlayerController(NetworkServiceHost.GetNetworkServiceHost()); Player whitePlayer = new Player(Color.White, whitePlayerControler); Player blackPlayer = new Player(Color.Black, blackPlayerControler); game = new Core.Game(engine, whitePlayer, blackPlayer, container, false); whitePlayer.Game = game; blackPlayer.Game = game; whitePlayerControler.Player = whitePlayer; blackPlayerControler.Player = blackPlayer; boardView.BoardViewPlayerControllers.Add((BoardViewPlayerController)whitePlayerControler); } else { PlayerControler whitePlayerControler = new NetworkPlayerController(NetworkServiceHost.GetNetworkServiceHost()); PlayerControler blackPlayerControler = new BoardViewPlayerController(boardView); Player whitePlayer = new Player(Color.White, whitePlayerControler); Player blackPlayer = new Player(Color.Black, blackPlayerControler); game = new Core.Game(engine, whitePlayer, blackPlayer, container, false); whitePlayer.Game = game; blackPlayer.Game = game; whitePlayerControler.Player = whitePlayer; blackPlayerControler.Player = blackPlayer; boardView.BoardViewPlayerControllers.Add((BoardViewPlayerController)blackPlayerControler); } //SMTPLogger smtpLogger = new SMTPLogger(game); return(game); }
public override Core.Game CreateGame(Container container, BoardView boardView, Color color, GameCreatorParameters parameters) { IEngine engine = new RealEngine(container); PlayerControler whitePlayerControler = new BoardViewPlayerController(boardView); PlayerControler blackPlayerControler = new UciProcessController(container, parameters.AiSearchType, parameters.AiSkillLevel, parameters.AiSearchValue); Player whitePlayer = new Player(Color.White, whitePlayerControler); Player blackPlayer = new Player(Color.Black, blackPlayerControler); Core.Game game = new Core.Game(engine, whitePlayer, blackPlayer, container, true); whitePlayer.Game = game; blackPlayer.Game = game; whitePlayerControler.Player = whitePlayer; blackPlayerControler.Player = blackPlayer; boardView.BoardViewPlayerControllers.Add((BoardViewPlayerController)whitePlayerControler); //TODO Remvoe the logger //SMTPLogger smtpLogger = new SMTPLogger(game); return(game); }