// DI Container enabled // public ConnectionHub() : this(UserConnectionManager.Instance, GameManager.Instance, new CookieService()) { } public ConnectionHub(/*UserConnectionManager connectionManager, GameManager gameManager, ICookieService cookieService*/ ILifetimeScope scope) { _connectionManager = scope.Resolve <UserConnectionManager>(); // connectionManager; _gameManager = scope.Resolve <GameManager>(); //gameManager; _cookieService = scope.Resolve <ICookieService>(); //cookieService; }
// DI Container enabled //public GameHub() : this(GameManager.Instance, UserConnectionManager.Instance, new CookieService()) { } public GameHub(ILifetimeScope scope) { _connectionManager = scope.Resolve <UserConnectionManager>(); // connectionManager; _gameManager = scope.Resolve <GameManager>(); //gameManager; _cookieService = scope.Resolve <ICookieService>(); //cookieService; }