public void CheckDrawSingleCard() { var cureDeck = new CureDeckManager(locationManager); var location = locationManager.GetLocations().First(); var drawnCard = cureDeck.DrawCard(); Assert.AreEqual <Location>(location, drawnCard); }
public CureDeckManager(ILocationManager locationManager) { _deck = new List <Location>(); _discard = new List <Location>(); _deck.AddRange(locationManager.GetLocations()); _deck.ShuffleDeck(); }
public InfectionDeckManager(ILocationManager locationManager) { _drawDeck = new List <Location>(); _discardDeck = new List <Location>(); _redrawDeck = new List <Location>(); _drawDeck.AddRange(locationManager.GetLocations()); _drawDeck.ShuffleDeck <Location>(); }
public BoardStateManager(ILocationManager locationManager) { _outbreakCount = 0; _locationManager = locationManager; _boardLocations = new Dictionary <Location, IDictionary <DiseaseColour, int> >(); foreach (Location location in _locationManager.GetLocations()) { IDictionary <DiseaseColour, int> cubeCounts = new Dictionary <DiseaseColour, int>(); foreach (DiseaseColour colour in Enum.GetValues(typeof(DiseaseColour))) { cubeCounts.Add(colour, 0); } _boardLocations.Add(location, cubeCounts); } }
public async Task <IActionResult> Get(Guid requesterId, Guid eventId) { logger.LogInformation("Getting location"); //validate string message = await locationManager.ValidateLocationRequest(requesterId, eventId); if (!string.IsNullOrEmpty(message)) { return(BadRequest(message)); } //put try catch only when you want to return custom message or status code, else this will //be caught in ExceptionHandling middleware so no need to put try catch here var result = locationManager.GetLocations(eventId); return(new OkObjectResult(result.Keys.Select(key => new { UserId = key, Location = result[key] }))); }
public Task <IEnumerable <Location> > GetLocations() { return(_locationManager.GetLocations()); }
// GET: Locations public async Task <IActionResult> Index() { return(View(await _context.GetLocations())); }