fpclass / perpetual-haskelling-initiative

Main repository for the CS141 Perpetual Haskelling Initiative
MIT License
0 stars 0 forks source link

Basic game types #9

Closed mbg closed 4 years ago

mbg commented 4 years ago

This PR adds some basic game types.

oscar-h64 commented 4 years ago

In terms of having the 3 different types of card, would it be sufficient to add something like

data CardType = CardProgram | CardError | CardEvent

Then add another field to the Card record to describe the card type, then the effect would be determined by what's in Program, or is it going to be more complex than that?

dixonary commented 4 years ago

If the different card types have different properties, then it might be more type-safe for the cards to be instances of one of three types.

So it would be like

data Card
 = CardProgram {...} 
 | CardError {...}

since, say, Error cards won't have a casting cost, nor an attack value.

oscar-h64 commented 4 years ago

Ah yeah. I don't know what fields different cards need, we only have name, description, paradigm and program in the Card definition. I think we probably need to decide the specifics on how the game works before the code can go any further

mbg commented 4 years ago

I think it may be good to merge this with just simple definitions that we can then build on, rather than trying to delegate the entire development to this branch.