Hi
I'm beginning a new game project involving Event data cards. Most have common types of data. They fall broadly into three types: terrain, movement or fire. Although there are some special event cards or modifier cards but on the whole, similar data on the most part. Except the fire opportuninty cards, where only 1 data type is in common. They will be all part of same deck. However, I not sure how best to manage & store the data for gameplay purposes. Are arrays the answer, structs, enums ... something else. Thanks.

I'd make an interface (ICard) and derive all cards from it. Possibly some abstract types for each category, then specific implementations for each card. I'd use List<T> to hold each players hand, and a Queue<T> for the deck.

I'd make an interface (ICard) and derive all cards from it. Possibly some abstract types for each category, then specific implementations for each card. I'd use List<T> to hold each players hand, and a Queue<T> for the deck.

Thanks!

Thanks Devmac, I'll have a look at that link for inspiration. Although the cards I'm thinking of are not like regular playing cards which have a clearly defined logical pattern. The nearest comparison I can give are those "Magic The Gathering" cards (or Pokemon cards).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.