public Resource[] DiscardCards(IGameState state, int toDiscard)
{
Console.WriteLine("You must discard " + toDiscard + " cards from you hand:");
var hand = state.GetOwnResources().ToList();
var cards = new Resource[toDiscard];
while (toDiscard-- > 0)
{
Console.WriteLine("Select a resource to discard:");
foreach (Resource resource in Enum.GetValues(typeof (Resource)))
{
if (hand.Count(r => r == resource) == 0) continue;
Console.WriteLine(((int)resource) + ") " + resource + " x " + hand.Count(r => r == resource));
}
//Keep trying if answering wrong
do
{
cards[toDiscard] = (Resource)int.Parse(Console.ReadLine());
} while (!hand.Remove(cards[toDiscard]));
}
return cards;
}