GUI card representation.

From: R. Clayton <rclayton_at_monmouth.edu>
Date: Tue, 8 Apr 2008 23:40:12 -0400
  The GUI handles cards as a string of two characters. Would it be possible to
  handle cards that are non-string objects?

Only if everybody agrees on what a Card is, which is unlikely.  In particular,
the Eagle's Wing definition of a Card

  file:///export/home/class/cs-310/1b/eagles-wing/doc/playerAPI/Card.html

only cares about whether two cards have the same suit and whether two cards
have consecutive ranks (that is, differ by +1 or -1); the actual suits or ranks
are irrelevant.  This abstraction level fits exactly what Eagle's Wing needs,
but probably doesn't fit most other games.

Even if spending the time to create a common Card abstraction is a good idea
(which it isn't), it's too late for that.  The alternative is to rely on a
lowest-common denominator representation, for which the two-character strings
seems the best candidate.

  Would it also be possible to handle ArrayLists and Stacks of these Cards?

I don't understand what "handle" means.  The gui internally handles piles as
arrays (note that fixing on strings avoids using generics).  It may mean
handling piles as arrays rather than stacks at the interface (although the
question seems to want to be able to do both, which is even more complex).
Although some games might find it convenient to be able to add or remove
arbitrary cards or slices from a pile, it would complicate the interface, and
games that don't need array handling would still have to deal with the
complexity.  A simpler, stack-based interface lets games that don't need extra
features get off cheaply and imposes the cost where it belongs: on games that
need extra capabilities.

But maybe "handle" means something else.
Received on Tue Apr 08 2008 - 23:41:05 EDT

This archive was generated by hypermail 2.2.0 : Fri Apr 11 2008 - 14:22:18 EDT