[Question/Learning] Design recommendation?

Hello all, I think this is a question on design methodology when using Linq… (I can speak PowerShell, but C# is still relatively new due to the strong typing of everything to me, and only experience so far with Linq is from Internet searches. I welcome "read this blogpost!" suggestions or StackOverflow.)

I am constructing a custom set of cards for a game.

Goal: I want to be able to add new properties to existing components, without breaking properties I already typed (spare the code refactoring and code updates).

E.G. Race: Human,Dwarf,Elf E.G. Race (add): Orc

I have a public interface, ICard.cs, and then a class for the Card.cs . I then am storing my current values in an enum within a {get; set;} of the Card.cs file.

My main questions at the moment:

  • Is it better to put the enum into a separate file somehow or keep it within the class file?

  • I am using List<T> to store enumerated cards for the "draw from" pile. Is this better than an Array in the long run if I don't know the player's hands are fixed sizes? (I would also be using a interface and another List to store the player's hand.)

by blackcamo via /r/csharp

Leave a Reply