O'Reilly logo

Learning Java Functional Programming by Richard M Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The game's architecture

The game uses several classes and interfaces. These are summarized here:

  • Character: This represents the player
  • Command: This represents a command and its arguments
  • Direction: This holds a direction, such as north or south, and the corresponding location you will arrive at for the direction
  • FunctionalCommands: This holds commands and executes them
  • FunctionalZork: This is the main class containing much of the game mechanics
  • GameElements: This holds collections of game elements and the current location
  • Item: This represents an item
  • Location: This represents a location in the game
  • NPC: This represents an NPC

We will explore how each of these classes is implemented. For a few of the classes, we will not show the getter/setter methods. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required