Exemple #1
0
 public Game(GameState state, IUserTopic topic, IBattleStrategy battleStrategy)
 {
     _state          = state ?? throw new ArgumentNullException(nameof(state));
     _hub            = new Hub(_state.Hub, topic);
     _map            = new Map(_state.Map);
     _topic          = topic ?? throw new ArgumentNullException(nameof(topic));
     _battleStrategy = battleStrategy ?? throw new ArgumentNullException(nameof(battleStrategy));
 }
Exemple #2
0
 public Lobby(LobbyState state, IUserTopic topic, IGameFactory gameFactory)
 {
     if (state == null)
     {
         throw new ArgumentNullException(nameof(state));
     }
     if (string.IsNullOrEmpty(state.RoomId))
     {
         throw new ArgumentException("Room id should be initialized", nameof(state));
     }
     _state       = state;
     _topic       = topic ?? throw new ArgumentNullException(nameof(topic));
     _gameFactory = gameFactory ?? throw new ArgumentNullException(nameof(gameFactory));
     Initialize();
 }
Exemple #3
0
 public Hub(HubState state, IUserTopic topic, ITimeProvider timeProvider)
 {
     _state        = state ?? throw new ArgumentNullException(nameof(state));
     _topic        = topic ?? throw new ArgumentNullException(nameof(topic));
     _timeProvider = timeProvider ?? throw new ArgumentNullException(nameof(timeProvider));
 }
Exemple #4
0
 public Hub(HubState state, IUserTopic topic)
     : this(state, topic, new SystemTimeProvider())
 {
 }