Question: public class Game { // your code goes here /** * This is the default constructors. * At most 10 player can play this game.

 public class Game { // your code goes here /** *

public class Game { // your code goes here /** * This is the default constructors. * At most 10 player can play this game. * At most there are 4 areas that players can play in. */ public Game() { // your code goes here } /** * This is the overloaded constructor for this class * @param player is an array containing all the players who entered the game. * @param map is the area that is available to the players to play. */ public Game (Player [] player, Map map) { // your code goes here } /** * This the copy constructor for this class * @param game is an object of Game, whose component is deeply copied into * the component of this object. */

public Game (Game game) { // your code goes here } /** * This is the getter method for the player list. * @return returns an array containing all the players of this game. */ public Player[] getPlayer() { // your code goes here - change the return return new Player[0]; } /** * This is the getter method for the map attribute. * @return Returns an object of map containing all the components of this game's map. */

public Map getMap() { // your code goes here - change the return return new Map(); } /** * This is the setter method for the player attribute, which deeply copies * the input parameter into the player attribute of this object. * @param player is an array of Player, whose elements are copied in the player attribute of this object. */ public void setPlayer(Player [] player) { // your code goes here } /** * This is the setter method for the map attribute, which deeply copies * the input parameter into the map attribute of this object. * @param map is an object of Map, whose attributes are copied in the map attribute of this object. */ public void setMap(Map map) { // your code goes here }

}

/** * * This class implements all a player requires to play in this game. * */ class Player { String name; Role role;

// your code goes here /** * This the default constructor for this class */ public Player() { // your code goes here } /** * This is the overloaded constructor for this class * @param name * @param role */ public Player(String name, Role role) { // your code goes here } /** * This is the copy constructor for this class * @param player */ public Player(Player player) { // your code goes here } /** * This is the getter method for attribute name * @return returns the value of attribute name */ public String getName() { // your code goes here - change the return return name; } /** * This is the getter method for attribute role * @return returns the reference to attribute role. */ public Role getRole() { // your code goes here - change the return return new Role(); } /** * This is the setter method for attribute name * @param name is the value that is used to initialize name attribute */ public void setName(String name) { // your code goes here } /** * This is the setter method for attribute role * @param role is the object, whose reference is used to initialize attribute role. */ public void setRole(Role role) { // your code goes here } } /** * This class implements the areas in which players can play. * */ class Map{ String theSkeld; String miraHq; String polus; String airShip; /** * This is the default constructor. */ public Map() { // your code goes here } /** * This is the overloaded constructor. * @param theSkeld is the first area in which player can play. * @param miraHq is the second area in which player can play. * @param polus is the third area in which player can play. * @param airShip is the fourth area in which player can play. */ public Map(String theSkeld, String miraHq, String polus, String airShip) { // your code goes here } /** * This is the copy constructor. * @param map is an object of Map that is used to initialize this object. */ public Map(Map map) { // your code goes here } } /** * * This class presents the role of the players, * which can be either imposter or crewmate. * Imposter role, gets the value of 'i'and * Cremate gets the value of 'c' * */ class Role{ char role; /** * This is the default constructor. */ public Role() { // your code goes here } /** * This is the overloaded constructor. * @param role is used as an initial value of the instance variable role */ public Role(char role) { // your code goes here } /** * This is the copy constructor. * @param role is an object of Role that is used to initialize the instance variable role. */ public Role(Role role) { // your code goes here } public char getRole() { // your code goes here - change the return return ' '; } public void setRole(char role) { // your code goes here } }

Player Role + name: String + role: Role + role: char + setRole(Role): void +getRole(): Role + setName(String): void + getName(): String - setRole(char):void + getRole(): char + fixWire(): void + download(): String + maintain(String):void + Kill(Player):Player Game - player: Player - map: Map Map + the Skeld: String + miraHq: String + polus: String + airShip: String setPlayer(Player[]): void getPlayer(): Player[] + setMap(Map[]); void getMap(): Map[]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!