public GameHub ( SessionService sessionService, GameService gameService, UserManager<UserModel> userManager, InvitationService invitationService, BoardService boardService, HubGroupService hubGroupService, GameActionService gameActionService ) { this.sessionService = sessionService; this.gameService = gameService; this.userManager = userManager; this.invitationService = invitationService; this.boardService = boardService; this.hubGroupService = hubGroupService; this.gameActionService = gameActionService; }
public Form1(int applicationId) { this.gameConfig = GameConfig.Configs[applicationId]; this.enemyServerAddres = applicationId == 1 ? GameConfig.Configs[2].ServerAdress : GameConfig.Configs[1].ServerAdress; this.enemyServerPort = applicationId == 1 ? GameConfig.Configs[2].Port : GameConfig.Configs[1].Port; // Создание сервисов и репозиториев gameRepository = ComponentsFactory.CreateGameRepository(); gameActionService = ServiceFactory.CreateGameActionService(); CreateAreas(); CreatePlayers(); CreateWalls(); drawingService = ServiceFactory.CreateDrawingService(); InitializeComponent(); Task.Run(() => { //RunServer(); RunCPPServer(); }); Task.Run(() => { while (!isGameEnd) { glControl1.Invalidate(); Thread.Sleep(100); } }); }