Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the UML, Implement a simple form of a Multi-User Domain that contains a si

ID: 3890275 • Letter: U

Question

Using the UML, Implement a simple form of a Multi-User Domain that contains a single player. All commands will be performed at the console using the Scanner class and output will simply be text printed to the console. Rooms will contain items that the player will be able to get and drop. That is the extent of what will be implemented at this stage. This should be done using Java

Requirements:

1. The single player will enter direction commands to move from room to room. The command get will allow the player to pick up an item in the room. If the item is not contained in the room an appropriate message should be displayed. The command drop will allow the player to drop an item that is being carried. Again, display appropriate messages for any error conditions.

2. After each command, messages to the console should display a description of the current room, with exits, and contents of the room.

3. The command exit will terminate the execution of the program.

4. When finished, export your project as a ZIP archive and submit one copy. Your code should be fully commented and your project should contain JavaDoc documentation for all your classes.

Doors Room properties connectRoom roomName containsltem containCharacter Game use0 Characters Room Doors Controls tems Item lookAround0 returnsDirections0 checkRoomName0 itemlsUsed itemlsPickedUp itemlsDropped temLocation MOBs pickUp0 drop0 useo move0 interact(0 exit0 ame movement orientation pickUp0 drop0 useo moveo interact0 Controls playerCommands Entity getCommand0 ame location Player Character characterName characterLocation ame inventory location move0 move useo interact(

Explanation / Answer

Game.java

package domain.multiUser;

import java.util.Scanner;

public class Game {

Character characters;

Room room;

Doors doors;

Controls controls;

Item items;

int Steps;

String Direction;

boolean hasItem;

void pickup(Item item){

if(true){

System.out.println("Pickup");

hasItem=true;

}

}

void drop(){

if(true){

System.out.println("Pickup");

hasItem = false;

}

}

void use(){

}

void move(int stp,String Dir){

System.out.println("Moving");

Steps = Steps+stp;

Direction=Direction+Dir;

}

void interact(){

System.out.println("Mission completed!! What next?");

}

static boolean exit(){

System.out.println("Exit!!");

return exit();

}

public static void main(String[] args){

Scanner sc = new Scanner(System.in);

System.out.println("Your Name ?");

String name = sc.next();

System.out.println("Enter Location");

String location = sc.next();

System.out.println("Enter Direction");

String direction = sc.next();

System.out.println("Name: "+ name + " Location: " + location + " Direction: " + direction);

Game g =new Game();

Room r = new Room("GameRoom","Gun","Sheela");

Player p = new Player("Tanmay","AK-47","Pune");

Character C = new Character("Sheela","Mumbai");

Entity e= new Entity("Sword","Delhi");

C.move(5, "North");

if(exit()){

Game.exit();

}

}

}

Room.java

package domain.multiUser;

public class Room {

String roomName;

String containsItem;

String containsCharacter;

void lookAround(String Dir){

String Direction = Dir;

System.out.println("Look Around in Direction" + Direction);

}

String returnsDirection(String Dir){

String Direction = Dir;

return Direction;

}

void checkRoomName(String rn){

String roomName = rn;

if(roomName==rn){

System.out.println("Room name: "+ roomName);

}

}

Room(String roomName, String containsItem, String containsCharacter){

roomName=this.roomName;

containsItem=this.containsItem;

containsCharacter=this.containsCharacter;

}

}

Doors.java

package domain.multiUser;

public class Doors {

String properties;

String connectRoom;

void use(){}

Doors(String properties,String connectRoom){

properties=this.properties;

connectRoom=this.connectRoom;

}

}

Item.java

package domain.multiUser;

public class Item {

String itemisUsed;

String itemPickedUp;

String itemDropped;

String itemLocation;

boolean hasitem;

void pickup(){

if(true){

System.out.println("Pickup");

hasitem=true;

}

}

void drop(){

if(true){

System.out.println("Pickup");

hasitem = false;

}

}

void use(){}

Item(String itemisUsed,String itemPickedUp,String itemDropped,String itemLocation){

itemisUsed=this.itemisUsed;

itemPickedUp=this.itemPickedUp;

itemDropped=this.itemDropped;

itemLocation=this.itemLocation;

}

}

MOBs.java

package domain.multiUser;

public class MOBs {

String name;

String movement;

String orientation;

void move(){}

void interact(){}

}

Controls.java

package domain.multiUser;

import java.util.Scanner;

public class Controls {

String playerControls;

void getCoommand(){

Scanner sc = new Scanner(System.in);

while(sc.hasNext()){

for(int i = 0;i <=10;i++){

System.out.println(i);

}

}

}

}

Entity.java

package domain.multiUser;

public class Entity {

String name;

String location;

Entity(String name, String location){

name=this.name;

location=this.location;

}

}

Character.java

package domain.multiUser;

public class Character {

String characterName;

String characterLocation;

int Steps;

String Direction;

void move(int stp,String Dir){

System.out.println("Moving");

Steps = Steps+stp;

Direction=Direction+Dir;

}

Character(String characterName, String characterLocation){

characterName=this.characterName;

characterLocation=this.characterLocation;

}

}

Player.java

package domain.multiUser;

public class Player {

String name;

String inventory;

String location;

void move(){}

void use(){}

void interact(){}

Player(String name,String inventory, String location){

name=this.name;

inventory=this.inventory;

location=this.location;

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote