Пример #1
0
        internal GlobalBoardState(EnginePlayer player1, EnginePlayer player2, Deck deck, Dictionary <Destination, Stack <Card> > discards)
        {
            CardsRemaining = deck.Count;

            Discards = new Dictionary <Destination, Card>(discards.Keys.Count);
            foreach (var destination in discards.Keys)
            {
                var cards = discards[destination];
                if (cards.Any())
                {
                    Discards.Add(destination, cards.Peek());
                }
            }

            Player1Expeditions = player1.GetExpeditions();
            Player2Expeditions = player2.GetExpeditions();
            Player1Cards       = player1.Cards.ToList(); // Maybe fishy way of creating a new list
            Player2Cards       = player2.Cards.ToList(); // Maybe fishy way of creating a new list
        }
Пример #2
0
        internal GlobalBoardState(EnginePlayer player1, EnginePlayer player2, Deck deck, Dictionary<Destination, Stack<Card>> discards)
        {
            CardsRemaining = deck.Count;

            Discards = new Dictionary<Destination, Card>(discards.Keys.Count);
            foreach (var destination in discards.Keys)
            {
                var cards = discards[destination];
                if (cards.Any())
                {
                    Discards.Add(destination, cards.Peek());
                }
            }

            Player1Expeditions = player1.GetExpeditions();
            Player2Expeditions = player2.GetExpeditions();
            Player1Cards = player1.Cards.ToList(); // Maybe fishy way of creating a new list
            Player2Cards = player2.Cards.ToList(); // Maybe fishy way of creating a new list
        }
Пример #3
0
        internal BoardState(Deck deck, Dictionary<Destination, Stack<Card>> discards, EnginePlayer you, EnginePlayer them)
        {
            CardsRemaining = deck.Count;

            Discards = new Dictionary<Destination, Card>(discards.Keys.Count);
            
            foreach (var destination in discards.Keys)
            {
                var cards = discards[destination];
                if (cards.Any())
                {
                    Discards.Add(destination, cards.Peek());
                }
            }

            YourExpeditions = you.GetExpeditions();
            TheirExpeditions = them.GetExpeditions();

            YourCards = you.Cards.ToList();
        }
Пример #4
0
        private static int Score(EnginePlayer player)
        {
            var total = 0;

            foreach (var expedition in player.GetExpeditions())
            {
                var score      = 0;
                var multiplier = 1;
                var bonus      = 0;

                if (expedition.Value.Any())
                {
                    score -= 20;
                }

                if (expedition.Value.Count >= 10)
                {
                    bonus += 20;
                }

                foreach (var card in expedition.Value)
                {
                    if (card.Value == 0)
                    {
                        multiplier++;
                    }
                    else
                    {
                        score += (int)card.Value;
                    }
                }

                total = total + (score * multiplier) + bonus;
            }

            return(total);
        }
Пример #5
0
        private static int Score(EnginePlayer player)
        {
            var total = 0;
            foreach (var expedition in player.GetExpeditions())
            {
                var score = 0;
                var multiplier = 1;
                var bonus = 0;

                if (expedition.Value.Any())
                {
                    score -= 20;
                }

                if (expedition.Value.Count >= 10)
                {
                    bonus += 20;
                }

                foreach (var card in expedition.Value)
                {
                    if (card.Value == 0)
                    {
                        multiplier++;
                    }
                    else
                    {
                        score += (int) card.Value;
                    }
                }

                total = total + (score * multiplier) + bonus;
            }

            return total;
        }