Пример #1
0
 public DevelopmentCard(DevelopmentCardTypes type, string title, string text)
 {
     this.Id    = Guid.NewGuid();
     this.Type  = type;
     this.Title = title;
     this.Text  = text;
 }
Пример #2
0
 public PlayerStateInstruction HeldCardsByType(DevelopmentCardTypes developmentCardType, int count)
 {
     if (this.developmentCardsByCount == null)
     {
         this.developmentCardsByCount = new Dictionary <DevelopmentCardTypes, int>();
     }
     this.developmentCardsByCount.Add(developmentCardType, count);
     return(this);
 }
Пример #3
0
        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");
                }
            }
        }
Пример #4
0
        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;
 }
Пример #6
0
        private void AssertNextDevelopmentCardIsCorrect(DevelopmentCardHolder developmentCardHolder, DevelopmentCardTypes expectedType)
        {
            DevelopmentCard developmentCard;

            developmentCardHolder.TryGetNextCard(out developmentCard).ShouldBeTrue();
            developmentCard.Type.ShouldBe(expectedType);
        }
Пример #7
0
 public ScenarioRunner ReceivesDevelopmentCardBoughtEvent(DevelopmentCardTypes developmentCardType)
 {
     this.developmentCardHolder.AddDevelopmentCard(developmentCardType);
     this.AddEventInstruction(new DevelopmentCardBoughtEvent(this.currentPlayerAgent.Id, developmentCardType));
     return(this);
 }
Пример #8
0
 public DevelopmentCardBoughtEvent(Guid playerId, DevelopmentCardTypes cardType) : base(playerId)
     => this.CardType = cardType;