Class GameConsole

java.lang.Object
edu.pdx.cs410J.security.GameConsole
Direct Known Subclasses:
GameConsolePriv

public class GameConsole extends Object
This class represents a game console that can play many games.
  • Constructor Details

  • Method Details

    • writePreferences

      public boolean writePreferences(Game game, String prefs)
      Called from the Game to write a game's preferences file.
      Returns:
      true if the preferences were sucessfully written (note that we don't want the name of the preferences file escaping!)
    • readPreferences

      public String readPreferences(Game game)
      Called from the Game to read a game's preferences file.
      Returns:
      null if the preferences could not be read
    • loadGame

      public Game loadGame(String gameName, String gameURL) throws Exception
      Loads a Game from a given URL.
      Throws:
      Exception
    • main

      public static void main(String[] args)
      The command line contains the name of the game and a URL from where to load it.