Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA please. Could someone please help me with writing this classt, thank you, please assume all interfaces are done and work properly classMap A Map
JAVA please.
Could someone please help me with writing this classt, thank you, please assume all interfaces are done and work properly
classMap A Map represents all the spots and things in a simulation, and provides some support methods for them as well. You will likely need to create the enumerations, interfaces, and many of the Thing classes before you can pull them all together with the Map class. Fields . protected Spot floorplan protected Thingl] things e protected java.io.PrintStream log Methods . Map(String filename, PrintStream log). Reads the given file to construct a map and all spots things on it. Any messages (such as safety or death messages) from this map will be sent to log any "map file" that is named in the first argument ("String filename") is assumed to have the same number of characters in each line, each line ends with a " " character, and each character is assumed to be one of our valid characters (see Ma invalidated, or the file doesn't even exist, your program does not need to function (behavior is undefined). You may add throws IOException to your method signature as necessary Manual Inspection Criteria (596). Well documented, elegant solution to reading the map text files. (See more details in the grading section of this project specification). o ations). If any of these assumptions is o public boolean onMap(Coord c). Answers if the given oord is on this Map public Spot spotAt(Coord c). Returns the Spot at the given Coord, if present (from the floorplan). If the Coord isn't on the map, this method will return null. * * * public int Returns how many people are stilltying to escape. Status.Safe and Status. Dead people don't count, but Status.Escaping people do get counted. Ihreats dont count either, of course public void addThing(Thing a). Occasionally new things should be added (usually these are threats that have spawned more spots of slime or haze). Accept a new Thing(assumed to be on the map), and cause the things field to be one spot longer, with this new one at the end. Remember, arrays can't change length. How will you get around this? (you can't change the type of the field) * Manual Inspection Criteria (5%); well-documented description ofyour approach to dealing with implementation). public Thing[] thingsAt(Coord c). Return an array of all Thing values found at the given coordinate Preserve the order of original appearance. If c isn't on the map, or no Thing is there, an empty array is returned. public boolean canLookThroughLocation(Coord c). Considering the spot and all things on that spot, can a person look through this location? If c isn't on the map, false is returned * * classMap A Map represents all the spots and things in a simulation, and provides some support methods for them as well. You will likely need to create the enumerations, interfaces, and many of the Thing classes before you can pull them all together with the Map class. Fields . protected Spot floorplan protected Thingl] things e protected java.io.PrintStream log Methods . Map(String filename, PrintStream log). Reads the given file to construct a map and all spots things on it. Any messages (such as safety or death messages) from this map will be sent to log any "map file" that is named in the first argument ("String filename") is assumed to have the same number of characters in each line, each line ends with a " " character, and each character is assumed to be one of our valid characters (see Ma invalidated, or the file doesn't even exist, your program does not need to function (behavior is undefined). You may add throws IOException to your method signature as necessary Manual Inspection Criteria (596). Well documented, elegant solution to reading the map text files. (See more details in the grading section of this project specification). o ations). If any of these assumptions is o public boolean onMap(Coord c). Answers if the given oord is on this Map public Spot spotAt(Coord c). Returns the Spot at the given Coord, if present (from the floorplan). If the Coord isn't on the map, this method will return null. * * * public int Returns how many people are stilltying to escape. Status.Safe and Status. Dead people don't count, but Status.Escaping people do get counted. Ihreats dont count either, of course public void addThing(Thing a). Occasionally new things should be added (usually these are threats that have spawned more spots of slime or haze). Accept a new Thing(assumed to be on the map), and cause the things field to be one spot longer, with this new one at the end. Remember, arrays can't change length. How will you get around this? (you can't change the type of the field) * Manual Inspection Criteria (5%); well-documented description ofyour approach to dealing with implementation). public Thing[] thingsAt(Coord c). Return an array of all Thing values found at the given coordinate Preserve the order of original appearance. If c isn't on the map, or no Thing is there, an empty array is returned. public boolean canLookThroughLocation(Coord c). Considering the spot and all things on that spot, can a person look through this location? If c isn't on the map, false is returned * *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