Question: JAVA -- IntelliJ In the Game constructor (Game Class), create a Scenario object, then get its startRoom and assign it to currentRoom. GAME CLASS
JAVA -- IntelliJ
In the Game constructor (Game Class), create a Scenario object, then get its startRoom and assign it to currentRoom.
GAME CLASS
""
public class Game { private Parser parser; private Room currentRoom; /** * Create the game and initialise its internal map. */ public Game() { createRooms(); parser = new Parser(); } }
""
SCENARIO CLASS
""
public class Scenario { private ArrayList rooms; private Room startRoom; private Random random; /** * Create a scenario */ public Scenario() { random = new Random(); // Set up your rooms, exits, and items // Move code from Game.createRooms here // Set the start room // Create the rooms ArrayList and add your rooms to it } /** * @return the start room for this scenario */ public Room getStartRoom() { // complete this method } /** * @return a random room from this scenario */ public Room getRandomRoom() { // complete this method } } ""
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
