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? }); }
public void ViewCard() { _card = _cards[0]; }
public IEnumerable <Selection> GetAttributes(ITopTrumpCard card, PropertyInfo[] properties) { var attributes = properties.Select((prop, i) => GetAttribute(card, prop, i)); return(attributes); }
public Player(List <ITopTrumpCard> cards) { _cards = cards; _card = cards[0]; }