Interface | Description |
---|---|
AbstractGameFactory |
Type of a class that produces specializations of
GameMaster for particular games given their names. |
CardComparator |
Comparison of 2 cards based on their suits and values.
|
GameObserver |
An observer of events occurred in a game instance.
|
GamePlayingStrategy |
A strategy for playing a particular game by an automated player
(a bot).
|
Player |
Common type to all players, including human players and bots.
|
Class | Description |
---|---|
CardCollection |
A collection of cards that may represent a full deck, a player's hand or
the cards on the table, for instance.
|
DefaultCardComparator |
A default implementation implementation of
CardComparator
based on the ranks of suits and values as defined by the respective
enumerations. |
GameBot |
An automatic card game player - a robot -
to plays all kinds of card games.
|
GameFactory |
Concrete participant of the Factory design pattern.
|
GameMaster |
Abstract class common to all game masters.
|
ObservableGame |
Observer management and event propagation in a game instance.
|
Enum | Description |
---|---|
GameMaster.GameStage |
Enumeration representing the stages of the game.
|
A core class is this package is GameMaster
. This is an abstract
class to support the definition of every game master supported by WCG.
For instance, the package {link wcg.games.war} contains an specialization
of this class for the WAR card game.
The creation of game masters for different games follows the Factory method design pattern and this package contains also the its abstract component.
This package contains also GameBot
, whose instances provide
automated players for all games. This class uses the Strategy
design pattern to support different ways the play and the the package
includes the required interface. Concrete strategies are contained
in the games's sub-package.
Communication between game masters and players, either humans players
or bots, is based on the Observer design pattern. This package
provides most of the abstract component. Since some of the events will need
to be propagated to clients their classes are defined elsewhere, in
wcg.shared.events
.
The class CardCollection
, heavily used by game masters and
bots, provides several methods to manipulate
collections of cards, from static methods to produce a deck cards, to
methods shuffle, select cards by suite, or select the highest or lowest
cards from a collection.
Several manipulations depend of a specific car order, and games
may have a specific order. The class provides a
DefaultCardComparator
, based in a comparators of suits and values,
that may be redefined by specific games. For example, the class
WarCardComparator
extends it and redefines methods, and provides
a specialized comparator for WAR games is provided by its game master.
jpleal@fc.up.pt