public void Card_PotteryAction1() { //testGame.Players[0].AlwaysParticipates = true; //testGame.Players[0].SelectsCards = new List<int>() { 0, 1 }; Mocks.PlayerDrawsCards(testGame.Players[0], 2); bool result = new Pottery().Actions.ToList()[0].ActionHandler(new CardActionParameters { TargetPlayer = testGame.Players[0], Game = testGame, ActivePlayer = testGame.Players[0], PlayerSymbolCounts = new Dictionary <IPlayer, Dictionary <Symbol, int> >() }); Assert.AreEqual(true, result); Assert.AreEqual(1, testGame.Players[0].Hand.Count); Assert.AreEqual(5, testGame.AgeDecks.Where(x => x.Age == 1).FirstOrDefault().Cards.Count); Assert.AreEqual(2, testGame.AgeDecks.Where(x => x.Age == 2).FirstOrDefault().Cards.Count); Assert.AreEqual(1, testGame.Players[0].Tableau.ScorePile.Count); Assert.AreEqual(2, testGame.Players[0].Tableau.GetScore()); Assert.AreEqual(0, testGame.Players[1].Tableau.ScorePile.Count); Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Blue].Cards.Count); Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Green].Cards.Count); Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Red].Cards.Count); Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Purple].Cards.Count); Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Yellow].Cards.Count); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Description,Features,List,OIS,IS_OB")] Pottery pottery) { if (id != pottery.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pottery); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PotteryExists(pottery.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pottery)); }
public HangingGardens() : base(30) { Name = "Hanging Gardens"; RequiredTech = new Pottery(); ObsoleteTech = new Invention(); SetSmallIcon(4, 2); Type = Wonder.HangingGardens; }
public Granary() : base(6, 1) { Name = "Granary"; RequiredTech = new Pottery(); SetIcon(0, 1, true); SetSmallIcon(0, 2); Type = Building.Granary; }
public async Task <IActionResult> Create([Bind("ID,Name,Description,Features,List,OIS,IS_OB")] Pottery pottery) { if (ModelState.IsValid) { _context.Add(pottery); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pottery)); }