public ScrimMatchEngine(IScrimTeamsManager teamsManager, IWebsocketMonitor wsMonitor, IStatefulTimer timer,
                                IScrimMatchDataService matchDataService, IScrimMessageBroadcastService messageService, IScrimRulesetManager rulesetManager, ILogger <ScrimMatchEngine> logger)
        {
            _teamsManager     = teamsManager;
            _wsMonitor        = wsMonitor;
            _timer            = timer;
            _messageService   = messageService;
            _matchDataService = matchDataService;
            _rulesetManager   = rulesetManager;

            // Copy default values to match config
            var activeRuleset = rulesetManager.ActiveRuleset;

            MatchConfiguration.TrySetTitle(activeRuleset.DefaultMatchTitle, false);
            MatchConfiguration.TrySetRoundLength(activeRuleset.DefaultRoundLength, false);
            MatchConfiguration.TrySetEndRoundOnFacilityCapture(activeRuleset.DefaultEndRoundOnFacilityCapture, false);

            _logger = logger;

            _messageService.RaiseMatchTimerTickEvent += async(s, e) => await OnMatchTimerTick(s, e);

            _messageService.RaiseTeamOutfitChangeEvent += OnTeamOutfitChangeEvent;
            _messageService.RaiseTeamPlayerChangeEvent += OnTeamPlayerChangeEvent;

            _messageService.RaiseScrimFacilityControlActionEvent += async(s, e) => await OnFacilityControlEvent(s, e);
        }
        public void PostTitle([FromBody] string newTitle)
        {
            var oldTitle = _configuration.Title;

            if (_configuration.TrySetTitle(newTitle, true))
            {
                if (newTitle != oldTitle)
                {
                    _configuration.Title = newTitle;
                    _messageService.BroadcastMatchConfigurationUpdateMessage(new MatchConfigurationUpdateMessage(_configuration));
                }
            }
        }