public GameEngine()
        {
            Deck = new List<Card>();
            DiscardedDeck = new List<Card>();
            CurrentYear = 1;
            QpLevel = 15;

            var humanPlayer = new Player("Human Player", this);
            var aI1 = new Player("AI 1", this);
            var aI2 = new Player("AI 2", this);

            PlayersList = new List<Player> { humanPlayer, aI1, aI2 };

            // Initial position.
            foreach (var player in PlayersList)
            {
                player.Position = 17;
            }

            AssignRandomSkillSets(PlayersList);
            InitiateDeck();
            ShuffleDeck();
            AssignRandomHands();
        }
예제 #2
0
 public override bool Play(Player player)
 {
     if (player.IntegrityChips >= 7)
     {
         player.QualityPoints += 3;
         player.LearningChips++;
         return true;
     }
     player.QualityPoints -= 3;
     return false;
 }
예제 #3
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 3)
     {
         player.QualityPoints += 5;
         return true;
     }
     player.QualityPoints -= 3;
     return false;
 }
예제 #4
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 3 && player.CraftChips >= 3 && player.IntegrityChips >= 3)
     {
         player.QualityPoints += 5;
         player.DrawCard();
         return true;
     }
     player.DiscardCard(this);
     return false;
 }
예제 #5
0
 public override bool Play(Player player)
 {
     player.LearningChips++;
     return true;
 }
예제 #6
0
 public override bool Play(Player player)
 {
     player.CraftChips++;
     return true;
 }
예제 #7
0
 public override bool Play(Player player)
 {
     if (player.IntegrityChips >= 2)
     {
         player.QualityPoints += 3;
         player.GetAChipOfHisChoice();
         return true;
     }
     player.DiscardCard(this);
     return false;
 }
예제 #8
0
 // Return true if success, false if failure.
 public abstract bool Play(Player player);
예제 #9
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 6)
     {
         player.QualityPoints += 5;
         player.GetAChipOfHisChoice();
         return true;
     }
     player.QualityPoints -= 3;
     return false;
 }
예제 #10
0
 public override bool Play(Player player)
 {
     if (player.IntegrityChips >= 5)
     {
         player.QualityPoints += 3;
         player.DrawCard();
         return true;
     }
     player.QualityPoints -= 2;
     return false;
 }
예제 #11
0
 public override bool Play(Player player)
 {
     if (player.CraftChips >= 8)
     {
         player.LearningChips++;
         player.CraftChips++;
         player.IntegrityChips++;
         return true;
     }
     player.QualityPoints -= 3;
     player.DiscardCard(this);
     return false;
 }
예제 #12
0
 public override bool Play(Player player)
 {
     if (player.CraftChips >= 5)
     {
         player.QualityPoints += 5;
         return true;
     }
     player.QualityPoints -= 3;
     return false;
 }
예제 #13
0
 public override bool Play(Player player)
 {
     if (player.CraftChips >= 3)
     {
         player.QualityPoints += 5;
         player.IntegrityChips++;
         return true;
     }
     player.Position = 2;
     return false;
 }
예제 #14
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 4)
     {
         player.CraftChips += 2;
         return true;
     }
     player.QualityPoints -= 2;
     return false;
 }
예제 #15
0
 public override bool Play(Player player)
 {
     if (player.CraftChips >= 2 && player.IntegrityChips >= 3)
     {
         player.QualityPoints += 3;
         player.GetAChipOfHisChoice();
         return true;
     }
     player.QualityPoints--;
     return false;
 }
예제 #16
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 2)
     {
         player.LearningChips++;
         player.DrawCard();
         return true;
     }
     player.QualityPoints -= 2;
     return false;
 }
예제 #17
0
 public override bool Play(Player player)
 {
     if (player.CraftChips >= 3)
     {
         player.GetAChipOfHisChoice();
         return true;
     }
     player.QualityPoints -= 2;
     return false;
 }
예제 #18
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 3)
     {
         player.IntegrityChips++;
         player.CraftChips++;
         return true;
     }
     player.Position = 20;
     return false;
 }
예제 #19
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 6)
     {
         player.QualityPoints += 5;
         return true;
     }
     player.Position = 2;
     return false;
 }
예제 #20
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 6 && player.CraftChips >= 6 && player.IntegrityChips >= 6)
     {
         player.QualityPoints += 10;
         return true;
     }
     player.LoseCard(this);
     return false;
 }
예제 #21
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 5)
     {
         player.QualityPoints += 5;
         return true;
     }
     player.QualityPoints -= 3;
     player.LoseCard(this);
     return false;
 }
예제 #22
0
 public override bool Play(Player player)
 {
     if (player.LearningChips >= 3)
     {
         player.QualityPoints += 5;
         player.DrawCard();
         player.DrawCard();
         return true;
     }
     player.QualityPoints -= 5;
     player.Position = 20;
     return false;
 }
예제 #23
0
 public override bool Play(Player player)
 {
     player.IntegrityChips++;
     return true;
 }
예제 #24
0
 public override bool Play(Player player)
 {
     if (player.IntegrityChips >= 4)
     {
         player.CraftChips += 2;
         return true;
     }
     player.Position = 13;
     return false;
 }
예제 #25
0
 public override bool Play(Player player)
 {
     if (player.Name == "Human Player")
     {
         var form = new UserChoiceForm("Select the chip you want", new[] { "Learning Chip", "Craft Chip" });
         form.ShowDialog();
         if (form.DialogResult == DialogResult.OK)
         {
             switch (form.GetCmbBoxSelectedContent())
             {
                 case "Learning Chip":
                     _reward = "1 Learning Chip";
                     player.LearningChips++;
                     break;
                 case "Craft Chip":
                     _reward = "1 Craft Chip";
                     player.CraftChips++;
                     break;
             }
         }
     }
     else
     {
         var bonus = new Random().Next(2);
         switch (bonus)
         {
             case 0:
                 _reward = "1 Learning Chip";
                 player.LearningChips++;
                 break;
             case 1:
                 _reward = "1 Craft Chip";
                 player.CraftChips++;
                 break;
         }
     }
     return true;
 }
예제 #26
0
 public override bool Play(Player player)
 {
     player.CraftChips++;
     player.Position = 20;
     return true;
 }
 public void ApplyQpStep(Player player)
 {
     if (player.QualityPoints < 0) player.QualityPoints = 0;
     else if (player.QualityPoints >= QpLevel)
     {
         player.GetAChipOfHisChoice();
         QpLevel += 15;
     }
 }
예제 #28
0
 public override bool Play(Player player)
 {
     player.GetAChipOfHisChoice();
     return true;
 }
        private void PlayComputer(Player player)
        {
            // Draw card.
            player.DrawCard();

            // Move between 0 and 3 times.
            var numberOfMoves = new Random().Next(4);
            for (int i = 0; i < numberOfMoves; i++)
            {
                var randomDestinationId = _gameEngine.RoomsAvailable[player.Position]
                [new Random().Next(_gameEngine.RoomsAvailable[player.Position].Count)];
                GoToARoom(_gameEngine.PlayersList.IndexOf(player), randomDestinationId);
            }

            var position = player.Position;

            // Play a random card.
            var randomCardIndex = new Random().Next(player.Hand.Count);
            var cardPlayed = player.Hand.ElementAt(randomCardIndex);
            var success = player.PlayCard(randomCardIndex);

            // Remove the card from the hand.
            player.Hand.Remove(cardPlayed);

            UpdateCurrentPlayPanel(_gameEngine.PlayersList.IndexOf(player), cardPlayed, success);

            var newPosition = player.Position;
            if (newPosition != position) GoToARoom(_gameEngine.PlayersList.IndexOf(player), newPosition);

            while (player.Hand.Count > 7) player.LoseCard(null);

            if (_gameEngine.CurrentYear == 1) _gameEngine.PassToSophomoreYearIfNeeded();
            _gameEngine.ApplyQpStep(player);
            if (_gameEngine.IsGameOver()) EndGame();
        }
예제 #30
0
 public override bool Play(Player player)
 {
     if (player.Name == "Human Player")
     {
         _reward = "1 Learning Chip";
         player.LearningChips++;
         if (MessageBox.Show("Choose!", "Do you want to discard a game card to get another Learning Chips?",
                 MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             _reward = "2 Learning Chips and 1 discarded card";
             player.LearningChips++;
             player.DiscardCard(this);
         }
     }
     else
     {
         var bonus = new Random().Next(2);
         switch (bonus)
         {
             case 0:
                 _reward = "1 Learning Chip";
                 player.LearningChips++;
                 break;
             case 1:
                 _reward = "2 Learning Chips and 1 discarded card";
                 player.LearningChips++;
                 player.DiscardCard(this);
                 break;
         }
     }
     return true;
 }