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)); }
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(); }
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)); }
public Hub(HubState state, IUserTopic topic) : this(state, topic, new SystemTimeProvider()) { }