I'm looking for a smart implementation of cards in a card game java implemented. Cards differ in the effect; some has one effect others two. There are a few different type of effect. I was thinking about a pattern (factory, decorator) to use with a Parser (cards effects are parsed from xml file).
Okay, assume you have a game model that consists of Game, Board, Pawn, Pawn.Color, Player, WinCondition, Card and Effect. A possible Effect type could be "card player switches two target pawns". It is implemented by asking the player who used the card to pick two pawns and then it switches the location of the two pawns. You can do this by giving the effect access to the entire game state. A card then simply consists of a list of effects. You can load a card from XML by referencing an identifier that the effect is known by inside the code.
It gets hairy if the effect has to interact with subclasses of those that I listed above. For instance, how do you make a subclass of Effect interact with a subclass of WinCondition? Here's where you can use the Visitor pattern.
You might also want to add new effects in "add-ons". You achieve this by adding a service provider interface (SPI) to your project, such as EffectProvider. In a plugin you implement EffectProvider and have it return new subtypes of the Effect interface.
What the best approach is depends strongly on your requirements. You need to tell us more if you want more help.