Class KaiserGame
java.lang.Object
de.aikiit.game.kaiser.KaiserGame
This class encapsulates the actual game flow.
A player
- is shown current statistics and
- can start to act
- until the maximum number of rounds is reached and the game ends.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe player can play at most this number of rounds. -
Constructor Summary
ConstructorsConstructorDescriptionInitializes a game with default parameters.KaiserGame(KaiserEngine engine, Scanner input) Allows setting an explicit engine for testing purposes. -
Method Summary
Modifier and TypeMethodDescriptionvoidactions()Performs user interactions.voidbanner()Shows the game's banner.voidShows console banner after the game is over.voidfinish()Shows results after the game is over.voidintro()Shows information about the game flow and welcomes the player.voidrun()Shows the introduction and start confirmation without the original BASIC code gate, then runs the reign until completion, dismissal or an abort.voidstatus()Shows the underlying status of the current round the player is in.
-
Field Details
-
MAX_ROUNDS
public static final int MAX_ROUNDSThe player can play at most this number of rounds.- See Also:
-
-
Constructor Details
-
KaiserGame
public KaiserGame()Initializes a game with default parameters. -
KaiserGame
KaiserGame(KaiserEngine engine, Scanner input) Allows setting an explicit engine for testing purposes.- Parameters:
engine- initialize with the given engine.
-
-
Method Details
-
run
public void run()Shows the introduction and start confirmation without the original BASIC code gate, then runs the reign until completion, dismissal or an abort. A replay starts again with the introduction and start confirmation. -
intro
public void intro()Shows information about the game flow and welcomes the player. -
banner
public void banner()Shows the game's banner. -
byeByeBanner
public void byeByeBanner()Shows console banner after the game is over. -
status
public void status()Shows the underlying status of the current round the player is in. -
actions
public void actions()Performs user interactions. The player can either- buy or sell land
- feed the population
- perform agricultural operations per round.
-
finish
public void finish()Shows results after the game is over.
-