Java游戏代写|Homework 6 HTW VIEW

这是一篇来自澳洲的Semester 1, 2023关于对铅质物质的空间旅行进行建模的Java代写

 

Abstract

The goal of this assignment is to implement and test a set of classes and interfaces1 .

Language requirements: Java version 17, JUnit 4.

Preamble

All work on this assignment is to be your own individual work. As detailed in Lecture 1, code supplied by course staff (from this semester) is acceptable, but there are no other exceptions. You are expected to be familiar with “What not to do” from Lecture 1 and https://www.itee.uq.

edu.au/itee-student-misconduct-including-plagiarism. If you have questions about what is acceptable, please ask course staff.

Please carefully read the Appendix A document. It outlines critical mistakes which you should circumvent in order to avoid losing marks. This is being heavily emphasised here because these are critical mistakes which must be avoided. If at any point you are even slightly unsure, please check as soon as possible with course staff!

All times are given in Australian Eastern Standard Time. It is your responsibility to ensure that you adhere to this time-zone for all assignment related matters. Please bear this in mind, especially if you are enrolled in the External offering and may be located in a different time-zone.

Introduction

In this assignment, you will take the role of an up and coming programming contractor. Your task will be to build a simple application. The script will take the form of a fictional story, to assist in your understanding of the task. This application is detailed in a specification given to you by the story’s protagonist. For this scenario, you will need to build up a system of classes and interfaces that meet the requirements that you have been given. For this assignment you will be focusing on accessor methods (getter’s and setter’s) as well building an understanding of Lists and basic programming logic.

Story

Hello my dear programmer friend,

I have come to understand that you might be in a position to help me. You see, I feel as if I am in a bit of a rut and have decided that I need to make a life altering change. I am going to resign my position as a celebrity insect therapist and pursue my dream of becoming a starship captain.

I have bought a slightly used starship, the Leaden Matter :

Before I take off for a life of adventure beyond the stars, I would like to be able to model my ship,my journeys, and the resources I will be shipping between ports. This is where you come in.

Should you accept, there are a few things that I need you to model:

  • Positions in space, as 3d coordinates;
  • SpacePorts I can travel to. There are a few types of SpacePort:

Generic SpacePorts I can stop at;

ShipYards where I can upgrade part of my ship; and

Stores where I can buy Resources.

  • Spaceships! Spaceships should have two Rooms, each of which can be upgraded to be more effective:

The CargoHold, which holds Resources; and

The NavigationRoom, where the galaxy map is kept, which allows me to fly or jump to

SpacePorts

Rooms on the spaceship are Damageable and take damage when I fly or jump.

  • Resources and their Containers, which include Repair Kits and Fuel.

I’m still new at this starship captain thing, so the program needs to be able to tell me when I don’t have enough room to put Resources in my CargoHold; when I don’t have enough resources to fly, jump or repair the ship; or when I’m trying to fly or jump to somewhere that doesn’t exist or is out of range.

Awesome, thanks so much!

– Jesko Thoch

Supplied Material

  • This task sheet.
  • Code specification document (Javadoc).2
  • A video showing the command line interface for the completed model.
  • Gradescope, a website where you will submit your assignment.3
  • A set of supporting files, available for download on Blackboard. These files provide functionality for some of the trickier parts of the program, and include a text-based user interface that will let you interact with your program once you’ve completed it. These files have been provided so that you can avoid (some of) the critical mistakes described in Appendix A.

Each of these files:

is in the correct directory (do not change this!)

has the correct package declaration at the top of the file (do not change this!)

has the correct public class or public interface declaration. Note that you may still need to make classes, extend classes, implement interfaces etc., as detailed in the Javadoc specification.

As the first step in the assignment (after reading through the specifications) you should download the template code from Blackboard. Once you have created a new project from the files you have downloaded, you should start implementing the specification.

Javadoc

Code specifications are an important tool for developing code in collaboration with other people. Although assignments in this course are individual, they still aim to prepare you for writing code to a strict specification by providing a specification document (in Java, this is called Javadoc).

You will need to implement the specification precisely as it is described in the specification document.

To view the Javadoc, navigate to the relevant assignment folder under Assessment on Blackboard and you will be able to download the Javadoc .zip file containing HTML documentation. Unzip the bundle somewhere, and open doc/index.html with your web browser.

Tasks

  1. Fully implement each of the classes and interfaces described in the Javadoc.
  2. Write JUnit 4 tests for all the methods in the following classes:
  • Position (in a class called PositionTest)
  • ResourceContainer (in a class called ResourceContainerTest

Marking

Your grade for the assignment will be determined based on your achievement in a number of categories, as shown in Tables 1 and 2.

Please note that Code Style grades are capped at the level of your Functionality grade. The reasoning here is to place emphasis on good quality functional code. Well styled code that does not implement the required functionality is of no value in a project, consequently marks will not be given to well styled code that is not functional.

Functionality Marking

Functionality evaluates if you have correctly implemented classes, properties and methods according to the specification.

Conformance

Conformance is marked by identifying conformance violations in your code. Note that multiple

conformance violations of the same type will each be counted as separate violations.

Conformance violations include (but are not limited to):

  • Placing files in incorrect directories.
  • Incorrect package declarations at the top of files.
  • Using modifiers on classes, methods and member variables that are different to those specified in the Javadoc. Modifiers include private, protected, public, abstract, final, and static. For example, declaring a method as public when it should be private.
  • Adding extra public methods, constructors, member variables or classes that are not described in the Javadoc.
  • Incorrect parameters and exceptions declared as thrown for constructors.
  • Incorrect parameters, return type and exceptions declared as thrown for methods.
  • Incorrect types of public fields.

Code Style

Code Structure and Layout

The Code Structure and Layout category is marked by identifying violations of the style guide in your code. Style violations in your solution will be detected and counted by CheckStyle using the course-provided configuration4 . Note that multiple style violations of the same type will each be counted as separate violations.

Note: There is a plugin available for IntelliJ which will highlight style violations in your code.

Instructions for installing this plugin are available in the Java Programming Style Guide on Blackboard (Learning Resources Guides). If you correctly use the plugin and follow the style requirements, it should be relatively straightforward to get high marks for this section. IntelliJ will also give you hints in the correct direction. Ensure you know the difference between a checkstyle and IntelliJ hint.