コード例 #1
0
ファイル: Player.cs プロジェクト: itplamen/SantaseCardGame
        private int CalculatePoints()
        {
            if (Hands.Any())
            {
                int handsSum         = Hands.SelectMany(x => x).Sum(x => (int)x.Type);
                int announcementsSum = Announcements.Any() ? Announcements.Values.Sum(x => (int)x) : 0;

                return(handsSum + announcementsSum + BonusPoints);
            }

            return(0);
        }
コード例 #2
0
        public TurnType GetTurnType()
        {
            var hand = Hands.LastOrDefault();

            if (!Hands.Any() || LastHandIsComplete())
            {
                return(TurnType.BeginHand);
            }
            else if (!hand.PickPhaseComplete)
            {
                return(TurnType.Pick);
            }
            else if (!hand.Buried.Any() && !hand.Leasters)
            {
                return(TurnType.Bury);
            }
            else
            {
                return(TurnType.PlayTrick);
            }
        }