Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 ArrayListrooms; 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started