What sort of design patterns and ideas might one use to build a somewhat general purpose card game framework?
This stems from I made an attempt to build a clone of the popular Steve Jackson game "Munchkin". Because of the nature of that game I ended having to hard code so many card functionalities that the development became chaotic and over-bearing. I had wanted to build something general but ended up with just to many classes with to many overridden functions and switch statements to determine behavior.
I was curious what someone with more experience in design would handle such a task of building a general purpose card game framework, or at least something that could be extended. Or is it best that if I want to make a simulation of a card game like Munchkin, i'm stuck making a specific framework.
I would like to use C#.
EDIT
I would like to clarify somewhat of what i'd eventually like to achieve. I'd like a framework where I can basically implement phases with custom functionality (phase 1: draw cards, phase 2: apply upkeep rules, phase 3: play cards, phase 4: resolve, etc).
I think then defining a ruleset would be wise which would be coupled with both the cards and the phases.
Then, the cards would be defined and I suppose tied to the rules so for instance a rule might be "During upkeep phase, lose 1 token". However, a card that the player has might provide "Don't lose any tokens during the upkeep phase". So it would be nice to be able to tie this together but within the guts of the framework.
I suppose this might be way out of my league as well.