public void SetInfo(Player player) { NameLabel.Text = player.ToString(); NameLabel.BackColor = CloseButton.BackColor = player.Color.StrongColor; int i = 0; foreach (var gem in Gems.GetAllGems()) { ResourceControls().ElementAt(i).Developments = player.GetDevelopmentsOfType(gem); ResourceControls().ElementAt(i).Gems = player.GemsOfType(gem); i++; } PrestigeLabel.Text = ((int)player.Prestige).ToString(); NoblesButton.Text = player.VisitedNobles.Count().ToString(); NoblesButton.FlatAppearance.MouseOverBackColor = player.Color.SoftColor.Darken(10); NoblesButton.Visible = player.VisitedNobles.Any(); NoblesButton.Tag = player.VisitedNobles; ReservesButton.Text = player.ReservedDevelopments.Count().ToString(); ReservesButton.Visible = player.ReservedDevelopments.Any(); GoldCounter.Gems = player.GemsOfType(Gems.Gold); GoldCounter.Visible = player.GemsOfType(Gems.Gold).Any(); TotalGemsButton.Text = $"{player.TotalGems().ToString()}/10"; }
private void CheckMarket(Market market, int[] values, int gold) { foreach (var gem in Gems.GetAllGems()) { market.AvaliableOfType(gem).Should().Be(values[gem.Id - 1]); market.AvaliableGold().Should().Be(gold); } }
public GemsServiceTests() { game = new Game(Prestige.FromScalar(15), (Avatars.Danilo, ColorFactory.DefaultBlue), (Avatars.Debra, ColorFactory.Gray)); foreach (var gem in Gems.GetAllGems()) { Take(gem.Get(2).ToArray()); } //Take(new Gem[3] { Gems.Diamond, Gems.Ruby, Gems.Onyx }); //Take(new Gem[3] { Gems.Diamond, Gems.Ruby, Gems.Onyx }); }
public void Development_requirements_should_be_compensated() { var list = new List <(Gem gem, int count)>(); foreach (var gem in Gems.GetAllGems()) { int count = 0; foreach (var item in deck) { count += item.TotalGemsOfType(gem); } list.Add((gem, count)); } list.Select(x => x.count).Distinct().Count().Should().Be(1); }
public void Should_contain_gems() { foreach (var gem in Gems.GetAllGems()) { simpleMarket.AvaliableOfType(gem).Should().Be(2); simpleMarket.CanBeTakenTwoOfType(gem).Should().BeFalse(); completeMarket.AvaliableOfType(gem).Should().Be(7); completeMarket.CanBeTakenTwoOfType(gem).Should().BeTrue(); } simpleMarket.AvaliableOfType(Gems.Gold).Should().Be(1); completeMarket.AvaliableOfType(Gems.Gold).Should().Be(5); simpleMarket.CanBeTakenTwoOfType(Gems.Gold).Should().BeFalse(); completeMarket.CanBeTakenTwoOfType(Gems.Gold).Should().BeFalse(); }
public void Noble_requirements_should_be_compensated() { var nobles = Nobles.GetNobles(); var list = new List <(Gem gem, int count)>(); foreach (var gem in Gems.GetAllGems()) { int count = 0; foreach (var noble in nobles) { count += noble.RequiredQuantity(gem); } list.Add((gem, count)); } list.Select(x => x.count).Distinct().Count().Should().Be(1); }