public GameService(ICardRepository cardRepository, IPlayerRepository playerRepository, IPlayerCardRepository playerCardRepository) { _cardRepository = cardRepository; _playerRepository = playerRepository; _playerCardRepository = playerCardRepository; _round = DefineCurrentRound(); }
public RoundService(IPlayerRepository playerRepository, IGameRepository gameRepository, IGamePlayerRepository gamePlayerRepository, IPlayerCardRepository playerCardRepository, ICardRepository cardRepository, IHistoryMessageManager historyMessageManager) { _playerRepository = playerRepository; _gameRepository = gameRepository; _gamePlayerRepository = gamePlayerRepository; _playerCardRepository = playerCardRepository; _cardRepository = cardRepository; _historyMessageManager = historyMessageManager; }
public GameService(IPlayerRepository playerRepository, IGameRepository gameRepository, IGamePlayerRepository gamePlayerRepository, IPlayerCardRepository playerCardRepository, IGamePlayerProvider gamePlayerProvider, ICardRepository cardRepository, ILogRepository logRepository) { _playerRepository = playerRepository; _gameRepository = gameRepository; _gamePlayerRepository = gamePlayerRepository; _playerCardRepository = playerCardRepository; _cardRepository = cardRepository; _gamePlayerProvider = gamePlayerProvider; _logRepository = logRepository; }
public GameSessionManager(UInt32 maximumPlayerCount, String logFileBasePath) { this.clients = new List <IClientCallback>(); this.waitingForGameSessionQueue = new ConcurrentQueue <AddPlayerMessage>(); this.gameSessions = new Dictionary <Guid, GameSession>(); this.maximumPlayerCount = maximumPlayerCount; this.cancellationTokenSource = new CancellationTokenSource(); this.gameSessionTokenFactory = new GameSessionTokenFactory(); this.playerCardRepository = new PlayerCardRepository(); this.loggerFactory = new FileLoggerFactory(logFileBasePath); this.State = States.Stopped; }
public GameSession(IGameSession gameManager, UInt32 maxPlayerCount, IPlayerCardRepository playerCardRepository, Guid gameSessionToken, CancellationToken cancellationToken, ILoggerFactory loggerFactory) { // No parameter checking done because this is not a public interface. this.GameSessionToken = gameSessionToken; this.gameManager = gameManager; this.clients = new IClientCallback[maxPlayerCount]; this.cancellationToken = cancellationToken; this.playerCardRepository = playerCardRepository; this.playerCards = new Dictionary <IClientCallback, PlayerData>(); this.messageQueue = new ConcurrentQueue <GameSessionMessage>(); this.loggerFactory = loggerFactory; this.clientsThatReceivedMessages = new HashSet <IClientCallback>(); }
public static Jabberwocky.SoC.Service.GameSessionManager CreateGameSessionManagerForTest(IGameSessionManager gameManagerFactory, UInt32 maximumPlayerCount, IPlayerCardRepository playerCardRepository) { /*var gameSessionManager = new GameSessionManager(gameManagerFactory, maximumPlayerCount, playerCardRepository); * gameSessionManager.WaitUntilGameSessionManagerHasStarted(); * return gameSessionManager;*/ throw new NotImplementedException(); }
public static Jabberwocky.SoC.Service.GameSessionManager AddPlayerCardRepository(this Jabberwocky.SoC.Service.GameSessionManager gameSessionManager, IPlayerCardRepository playerCardRepostory) { gameSessionManager.PlayerCardRepository = playerCardRepostory; return(gameSessionManager); }