public DevelopmentCard(DevelopmentCardTypes type, string title, string text) { this.Id = Guid.NewGuid(); this.Type = type; this.Title = title; this.Text = text; }
public PlayerStateInstruction HeldCardsByType(DevelopmentCardTypes developmentCardType, int count) { if (this.developmentCardsByCount == null) { this.developmentCardsByCount = new Dictionary <DevelopmentCardTypes, int>(); } this.developmentCardsByCount.Add(developmentCardType, count); return(this); }
internal void SetHeldCard(int cardCount, DevelopmentCardTypes developmentCardType) { while (cardCount-- > 0) { switch (developmentCardType) { case DevelopmentCardTypes.Knight: this.HeldCards.Add(new KnightDevelopmentCard()); break; case DevelopmentCardTypes.Monopoly: this.HeldCards.Add(new MonopolyDevelopmentCard()); break; case DevelopmentCardTypes.RoadBuilding: this.HeldCards.Add(new RoadBuildingDevelopmentCard()); break; case DevelopmentCardTypes.YearOfPlenty: this.HeldCards.Add(new YearOfPlentyDevelopmentCard()); break; default: throw new ArgumentException($"{developmentCardType} type not recognised", "developmentCardType"); } } }
public void AddDevelopmentCard(DevelopmentCardTypes developmentCardType) { DevelopmentCard developmentCard = null; switch (developmentCardType) { case DevelopmentCardTypes.Knight: developmentCard = new KnightDevelopmentCard(); break; case DevelopmentCardTypes.Monopoly: developmentCard = new MonopolyDevelopmentCard(); break; case DevelopmentCardTypes.RoadBuilding: developmentCard = new RoadBuildingDevelopmentCard(); break; case DevelopmentCardTypes.YearOfPlenty: developmentCard = new YearOfPlentyDevelopmentCard(); break; default: throw new NotImplementedException($"Development card type {developmentCardType} not recognised"); } this.developmentCards.Enqueue(developmentCard); }
public ScenarioBuyDevelopmentCardEvent(ScenarioComputerPlayer player, DevelopmentCardTypes developmentCardType) : base(player.Id) { this.developmentCardType = developmentCardType; this.player = player; }
private void AssertNextDevelopmentCardIsCorrect(DevelopmentCardHolder developmentCardHolder, DevelopmentCardTypes expectedType) { DevelopmentCard developmentCard; developmentCardHolder.TryGetNextCard(out developmentCard).ShouldBeTrue(); developmentCard.Type.ShouldBe(expectedType); }
public ScenarioRunner ReceivesDevelopmentCardBoughtEvent(DevelopmentCardTypes developmentCardType) { this.developmentCardHolder.AddDevelopmentCard(developmentCardType); this.AddEventInstruction(new DevelopmentCardBoughtEvent(this.currentPlayerAgent.Id, developmentCardType)); return(this); }
public DevelopmentCardBoughtEvent(Guid playerId, DevelopmentCardTypes cardType) : base(playerId) => this.CardType = cardType;