An object-oriented game written in Java using libGDX.
There is a UML class diagram of each package located in the README file of each package directory. It is visible directly when navigating to the package directory on GitHub, but if viewing the files locally the raw images can be found in documents/diagrams/
.
- Java 15 or later
To run the latest version of the game, download the jar file from releases and run it using the command:
java -jar ColonyManagement-vX.X.X.jar
To build the game directly from the source code, you need to have some common development tools installed.
- JDK 15
- Maven installed according to instructions
- JAVA_HOME environment variable set to point to JDK 15
- Clone the repository using
git clone https://github.com/martinjonsson01/OOPP-WITH-THE-BOIS.git
or downloading as ZIP. - Navigate to the root directory:
cd OOPP-WITH-THE-BOIS
- Run
mvn clean test
to download runtime dependencies and test dependencies, and to check that the program is running correctly. - Run
mvn compile exec:java
to start the program.
- You get
java.lang.UnsupportedClassVersionError
.- You're running the program with too old a version of Java. You need Java 15 or later. If you have it installed, then your environment variables are incorrectly configured. Make sure your Path environment variable contains a path to the
bin
folder of your Java installation. Also make sure that no older versions of Java are in your Path (both user and system variables)
- You're running the program with too old a version of Java. You need Java 15 or later. If you have it installed, then your environment variables are incorrectly configured. Make sure your Path environment variable contains a path to the
mvn
not recognized as a command.- The
bin
folder of the Maven installation has not been added to the PATH environment variable.
- The
mvn
outputs "The JAVA_HOME environment variable is not defined correctly"- The environment variable
JAVA_HOME
in Windows is not set to the path of the installed JDK 15 (should not be the bin folder).
- The environment variable
- Not using the correct JDK version.
- Double check the version by running
java --version
. It should be15.0.2
or later. If it is incorrect, update yourJAVA_HOME
and/orPATH
environment variables.
- Double check the version by running
To ensure Pawntastic follows good code practices a number of tools have been and is being used in the development of the project. Each subsection will go over the usage of the tool and how to use/run it.
(Maven is suggested for running these tools for the project.)
The answer to "What is JDepend?" found on their FAQ page describes the tool perfectly.
JDepend is a tool that traverses Java class file directories and generates design quality metrics for each Java package. JDepend allows you to automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to manage package dependencies effectively.
Use JDepend on Pawntastic by following these steps:
- Run
mvn jdepend:generate
- Open the HTML file generated by maven located in
target/site/jdepend-report.html
.
PMD is a tool that performs a code analysis on the source code and generates a report based on the findings. The tools can analyze for bad practices and can also run a Copy/Paste Detector.
Use the code analysis by following these steps:
- Run
mvn pmd:pmd
- open the HTML file (located here:
target/site/pmd.html
) to see the report.
Use the CopyPaste Detector by following these steps:
- Run
mvn pmd:cpd
- open the HTML file (located here:
target/site/cpd.html
) to see the report.
Checkstyle is a tool used for alerting the developer if any violation of common good practices or code style. (The same plugin can be installed directly into IntelliJ for faster/easier reporting).
A site with the report of any violation can be generated by following these steps:
- Run
mvn checkstyle:checkstyle
- open the HTML file (located here:
target/site/checkstyle.html
) to see the report.