Beispiel #1
0
 public MatchService(IMatchmakingService matchmakingService, IMatchEngine matchEngine, IMatchRepository matchRepository, IBus bus)
 {
     _matchmakingService = matchmakingService;
     _matchEngine        = matchEngine;
     _matchRepository    = matchRepository;
     _bus = bus;
 }
 public GamesController(IHttpContextAccessor httpContextAccessor, IHubContext <ChatHub> hubContext,
                        IMatchmakingService matchmakingService, IConnectionMapping connectionMapping)
 {
     _httpContextAccessor = httpContextAccessor;
     _hubContext          = hubContext;
     _matchmakingService  = matchmakingService;
     _connectionMapping   = connectionMapping;
 }
        private void HostStarted(IHost host)
        {
            host.AddSceneTemplate("matchmaker-template", matchmakingScene =>
            {
                if (_matchmakingService == null)
                {
                    throw new InvalidOperationException("There may only be one matchamking scene.");
                }

                _matchmakingService = _factory.CreateMatchmakingService();
                _matchmakingService.Init(matchmakingScene);

                matchmakingScene.AddProcedure("matchmaking.request", _matchmakingService.FindMatch);

            });
        }
Beispiel #4
0
 public MatchmakingHub(IMatchmakingService matchmakingService, IMatchService matchService)
 {
     _matchmakingService = matchmakingService;
     _matchService       = matchService;
 }