[Kde-games-devel] enums for unified CardCache

Andreas Pakulat apaku at gmx.de
Tue Feb 5 00:00:13 CET 2008


Hi,

so I'm done with moving kpat to the CardCache class I've developed.
Quite a lot of code from kpat has been removed due to this, though as
far as I can tell there's no much improvement in speed.

Anyway, some time ago there was mentioning of extending the CardCache
(at a later time) to also handle larger decks, like mahjongg or even
tarot.

This leads to a problem: Currently CardCache uses 1 flag value to
identifiy which front side to draw. This limits us to 32 different flags
to indicate the frontside, where 18 are already taken by a simple 52
card deck.

So the question is what to do here to ensure future extensibility. 

An easy option would be to again separate suite type and card type and
pass them as separate parameters. However I'm not quite sure this fits
well with something other than normal patience-like card games.

Another option would be to allow a QString parameter to identify the
card, this means the most flexibility, but also the most fragility in
the CardCache code. There's no real type checking possible with this and
things will get badly broken when the user selects an svg deck that
doesn't contain the elements given to the cache.

Opinions? Other Ideas?

Andreas

-- 
You seek to shield those you love and you like the role of the provider.


More information about the kde-games-devel mailing list