Exemplo n.º 1
0
 public object Clone()
 {
     return(new StickRoundInfo
     {
         PlayActionList = PlayActionList
                          ?.Select(p => (PlayAction)p?.Clone())?.ToList(),
         StickResult = (StickResult)StickResult?.Clone()
     });
 }
Exemplo n.º 2
0
        private StickResult GetStickResult()
        {
            if (!StickSuit.HasValue || PlayActionList.Count != 4)
            {
                return(null);
            }
            var winner = PlayActionList
                         .OrderByDescending(a => a.Card, GetCardComparer())
                         .First()
                         .PlayerInfo;
            var cardList = PlayActionList
                           .Select(a => a.Card)
                           .ToList();
            var stickResult = new StickResult
            {
                Winner    = winner,
                StickPile = cardList
            };

            return(stickResult);
        }