public CreateGameController( IGameStore gameStore = null, IGameProfileFactory gameProfileFactory = null) { _gameStore = gameStore ?? new GameStore(); _gameProfileFactory = gameProfileFactory ?? new GameProfileFactory(); }
public static Quest CreateStartedWithMaleHero(out IGameStore gameStore, out Guid gameId, out Guid playerId, out Sequence sequence) { var quest = CreateStarted(out gameStore, out gameId, out sequence); addMaleHeroToQuest(quest, sequence, gameId, out playerId); return(quest); }
private void ValidateAttack(IGameStore store, Guid playerId, Models.Battleship battleship) { if (battleship.PlayerId == playerId) { throw new OwnBattleshipAttackedException(playerId, battleship.Id); } }
public GameRetrieverService(IGameStore gameStore, IReporter reporter, IConfigurationService configService) { _gameStore = gameStore; _reporter = reporter; _configService = configService; _parser = new DrawParser(); }
public static Quest CreateStarted(out IGameStore gameStore, out Guid gameId, out Sequence sequence) { var quest = CreateStored(out gameStore, out gameId); sequence = new Sequence(); startQuest(quest, sequence, gameId); return(quest); }
public static Quest CreateStored(out IGameStore gameStore, out Guid gameId) { gameStore = new VolatileGameStore(); var quest = Create(gameStore); gameId = quest.StartJourney(); return(quest); }
public UserActivityPerDayController( IMemoryCache memoryCache, AllUserActivityCache allUserActivityCache = null, IGameStore gameStore = null) { _allUserActivityCache = allUserActivityCache ?? new AllUserActivityCache(memoryCache); _gameStore = gameStore ?? new GameStore(); }
public GameIconController( IMemoryCache memoryCache, IHttpClientFactory httpClientFactory, IGameStore gameStore = null) { _memoryCache = memoryCache; _httpClientFactory = httpClientFactory; _gameStore = gameStore ?? new GameStore(); }
public DashboardViewModel(IGameStore gamestore, INavigationService navigation) { if (gamestore == null) throw new ArgumentNullException(nameof(gamestore)); if (navigation == null) throw new ArgumentNullException(nameof(navigation)); this.gamestore = gamestore; this.navigation = navigation; }
public UserActivityForMonthController( IMemoryCache memoryCache, AllUserActivityCache allUserActivityCache = null, IGameStore gameStore = null, ITimeSpentByHourCalculator timeSpentByHourCalculator = null) { _allUserActivityCache = allUserActivityCache ?? new AllUserActivityCache(memoryCache); _gameStore = gameStore ?? new GameStore(); _timeSpentByHourCalculator = timeSpentByHourCalculator ?? new TimeSpentByHourCalculator(); }
public Guid Execute(IGameStore store, Guid playerId, IReadOnlyList <Coordinate> coordinates) { var battleshipId = Guid.NewGuid(); ValidateCoordinates(playerId, coordinates); AddBattleship(store, playerId, coordinates, battleshipId); return(battleshipId); }
public GameService( ILogger <GameService> logger, IMapper mapper, CoreOptions options, Defaults defaults, IGameStore store ) : base(logger, mapper, options) { Store = store; Defaults = defaults; }
public override RealizeLotteryResult RealizeLottery(IGameStore <Game> store) { var quadraGames = new List <Game>(); var quinaGames = new List <Game>(); var megaGames = new List <Game>(); var result = new RealizeLotteryResult(); if (store.Store.Count == 0) { result.Success = false; result.Error = "Não existem jogos pra realizar um sorteio."; return(result); } var currentLotteryNumbers = this.GetLotteryNumbers(); foreach (var storeItem in store.Store) { var currGame = storeItem.Value; var matches = 0; foreach (var number in currGame.Numbers) { if (currentLotteryNumbers.Contains(number)) { matches++; } } if (matches == 4) { quadraGames.Add(currGame); } else if (matches == 5) { quinaGames.Add(currGame); } else if (matches == 6) { megaGames.Add(currGame); } } result.LotteryNumbers = currentLotteryNumbers; result.QuadraGames = quadraGames.ToArray(); result.QuinaGames = quinaGames.ToArray(); result.MegaGames = megaGames.ToArray(); result.Success = true; return(result); }
public PlayerService( IPlayerStore store, IGameStore gameStore, IMapper mapper, IMemoryCache localCache, ITopoMojoApiClient mojo ) { Store = store; GameStore = gameStore; Mapper = mapper; LocalCache = localCache; Mojo = mojo; }
public bool Execute(IGameStore store, Guid playerId, Coordinate coordinate) { var battleship = store.GetBattleship(coordinate); if (battleship == null) { return(false); } ValidateAttack(store, playerId, battleship); SaveAttackResult(coordinate, battleship); return(true); }
public virtual DoLotteryResult DoLottery() { var result = new DoLotteryResult(); var realizeLotteryResult = this._lottery.RealizeLottery(this.GameStore); if (realizeLotteryResult.Success) { realizeLotteryResult.Id = _currId; _currId++; //verificar se esses numeros já foram sorteados, se sim, tentar novamente foreach (var lottery in this.HistoryLotteries) { if (lottery.Value.LotteryNumbers.SequenceEqual(realizeLotteryResult.LotteryNumbers)) { return(DoLottery()); } } //armazenar os numeros sorteados, juntamente com os jogos que fizeram quadra, quina e mega this.HistoryLotteries.Add(realizeLotteryResult.Id, realizeLotteryResult); result.Content = this.GetLotteryOutput(realizeLotteryResult); //limpar o gameStoreAtual this.GameStore = new GameStore(); result.Success = true; } else { result.Success = false; result.Error = realizeLotteryResult.Error; } return(result); }
public abstract RealizeLotteryResult RealizeLottery(IGameStore <Game> store);
public GamesController(IGameStore gamestore) { this.gamestore = gamestore; }
public Quest(IGameStore gameStore, IEventInventory eventInventory) { _gameStore = gameStore; _eventInventory = eventInventory; }
public GameController(IGameStore store, ISymbolStore symbolStore) { _store = store; _symbolStore = symbolStore; }
public GameDetailsModel(IGameStore gameStore, IImageStore imageStore) { _gameStore = gameStore ?? throw new ArgumentNullException(nameof(gameStore)); _imageStore = imageStore ?? throw new ArgumentNullException(nameof(imageStore)); }
public PlayerGraphGenerator(Player player, IGameStore drawStore) { _player = player; _drawStore = drawStore; }
public GamesController(IGameStore gameStore) { _gameStore = gameStore; }
public static Quest Create(IGameStore gameStore) { var eventInventory = new Inventory(); return(new Quest(gameStore, eventInventory)); }
public UploadCardsModel(ICardStore cardStore, IGameStore gameStore, IImageStore imageStore) { _cardStore = cardStore ?? throw new ArgumentNullException(nameof(cardStore)); _gameStore = gameStore ?? throw new ArgumentNullException(nameof(gameStore)); _imageStore = imageStore ?? throw new ArgumentNullException(nameof(imageStore)); }
public HomeModel(IGameStore gameStore) { _gameStore = gameStore ?? throw new ArgumentNullException(nameof(gameStore)); }
public void CantBeConstructedWithNull(IGameStore store, INavigationService navigation) { Assert.Throws<ArgumentNullException>(() => new DashboardViewModel(store, navigation)); }
public CardsController(IGameStore gameStore, ICardStore cardStore, IImageStore imageStore) { _gameStore = gameStore ?? throw new ArgumentNullException(nameof(gameStore)); _cardStore = cardStore ?? throw new ArgumentNullException(nameof(cardStore)); _imageStore = imageStore ?? throw new ArgumentNullException(nameof(imageStore)); }
public GameController(IGameStore gameStore, IHubContext <GameHub> context) { _store = gameStore; _clients = context.Clients; }
public LotteryProgram() { this.GameStore = new GameStore(); this.HistoryLotteries = new Dictionary <int, RealizeLotteryResult>(); this._lottery = (TLottery)Activator.CreateInstance(typeof(TLottery)); }
public OrdersController(OrderService orderService, IGameStore gameStore, ILogger <OrdersController> logger) { _orderService = orderService; _gameStore = gameStore; _logger = logger; }
public GameManager(IGameStore gameStore) { _gameStore = gameStore; }
public GameValidator( IGameStore store ) { _store = store; }