예제 #1
0
 public Selection GetAttribute(ITopTrumpCard card, PropertyInfo property, int id)
 {
     return(new Selection
     {
         Id = id,
         Player = this,
         Name = card.Name,
         Property = property.Name,
         Value = property.GetValue(card).ToString()
                 // why does this work with the 'card' parameter, but not the '_card' property?
     });
 }
예제 #2
0
 public void ViewCard()
 {
     _card = _cards[0];
 }
예제 #3
0
        public IEnumerable <Selection> GetAttributes(ITopTrumpCard card, PropertyInfo[] properties)
        {
            var attributes = properties.Select((prop, i) => GetAttribute(card, prop, i));

            return(attributes);
        }
예제 #4
0
 public Player(List <ITopTrumpCard> cards)
 {
     _cards = cards;
     _card  = cards[0];
 }