- Objective:
- To create a casino simulation.
- Your application must have at the very least 4 games:
- Go Fish a card game
- BlackJack a card game
- Craps a dice game
- Slots a mechanical game
- The project should include some concept of each of the following classes.
- Description:
Profile
stores a casino-visitor'sid
,name
, andbalance
.
Profile
objects should be created within the context of a casino.Profile
objects storeprofileId
,username
, andbalance
.
-
Description:
PlayerInterface
is a contract to ensure that all players have reference to aprofile
,name
, andid
.
-
PlayerInterface
should declare 3 methodsProfile getProfile()
String getName()
Long getId()
- Description:
- Represents a player within the context of a game.
- should cease to exist upon termination of a game.
Player
should implementPlayerInterface
Player
objects should be created within the context of a game.
- Description:
- Represents a game which handles some type of player.
- should be parameterized with a generic type whose upper bound is
PlayerInterface
.- e.g. -
SomePlayerType
is a subclass ofPlayerInterface
. - This restricts the types of players this game can interact with.
- e.g. -
GameInterface
should declare each of the following methods:TypeOfPlayer[] getPlayers()
TypeOfPlayer getPlayer(Long playerId)
void addPlayer(TypeOfPlayer player)
void removePlayer(TypeOfPlayer player)
Boolean contains(TypeOfPlayer player)
-
Description:
GameEngineInterface
is a contract which ensures a specific type ofGameEngine
operates on a specific type ofPlayer
and a specific type ofGame
-
should be parameterized with two generic types
GameTypePlayer
a sub class ofPlayerInterface
GameType
a sub class ofGameInterface<GameTypePlayer>
-
should declare three method signatures
GameType getGame()
- return the composite Game object to the client.
void evaluateTurn(GameTypePlayer player)
- evaluate the turn of a player,
void run()
- begin game
- Description
GameEngine
ensures all sub-classes provide aGame
object upon instantiation.
- should be parameterized with two generic types
GameTypePlayer
a sub class ofPlayerInterface
GameType
a sub class ofGameInterface<GameTypePlayer>
- should implement a
GameEngineInterface<GameType, GameTypePlayer>
- should defer the definition of
evaluateTurn
andrun
to sub-classes.
- Description
- Contract which ensures that a class enforces some aspect of waging money.
- Go fish is a friendly game and should not involve gambling.
BlackJack
andGoFish
are both Card Games and should therefore inherit from a commonCardGame
.- Any common logic or fields between the games should live CardGame class, not BlackJack nor GoFish.
- You must have a completed and approved UML diagram before you proceed to do any development
- You can either work by yourself, or in a group no bigger than 3.
- All public methods should be tested.