This project was carried out as part of the ap4b subject object-oriented design in Java and UML).
This project is a management game, in which you build your city. This game simulates the electrical distribution of the play area.
The goal of the player is to be able to supply the entire population located in the playing area while
minimizing energy costs for residents and minimizing pollution.
This program has been tested on JDK 16.0.1 for both methods
First, you need to clone this repository :
git clone https://github.com/gabswb/ap4b-simpower.git
cd ap4b-simpower
Or you can just download the zip archive of this repo
- You need to have Maven installed on your computer
mvn compile
mvn clean package
This will create in the target folder a .jar not executable !
To execute it run this :
java -cp target/Simpower-1.0.jar main.java.Main
cd src
mkdir classes
javac -d classes main/java/*.java
java -cp ./main/resources;./classes main.java.Main
java -cp ./main/resources:./classes main.java.Main
Build the docker image
docker build -f Dockerfile -t simpower:1.0 .
Run the container
docker run -it simpower:1.0
Warning
If you run it just like this you will have a java.awt.HeadlessException Exception
You need to :
-
Install vcxsrv
-
Start the Xlaunch
docker run -it --rm -e DISPLAY=${ipaddress of hostmachine} image/bin/bash