Skip to content

Commit

Permalink
Merge pull request #10 from BME-MIT-IET/Csongor
Browse files Browse the repository at this point in the history
Csongor
  • Loading branch information
pupcs authored May 20, 2024
2 parents 2323006 + 3ca93c5 commit 237f770
Show file tree
Hide file tree
Showing 107 changed files with 906 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/libraries/Maven__javax_xml_bind_jaxb_api_2_3_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/libraries/Maven__joda_time_joda_time_2_9_2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/libraries/Maven__junit_junit_4_12.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 73 additions & 10 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,81 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.17.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>7.17.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>cucumber-gherkin</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>cucumber-gherkin-messages</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>messages</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>testng-xml-formatter</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>tag-expressions</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>cucumber-expressions</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>datatable</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>cucumber-plugin</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>docstring</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>html-formatter</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>junit-xml-formatter</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>ci-environment</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.5.0</version>
</plugin>
</plugins>
</reporting>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
</project>
18 changes: 6 additions & 12 deletions gs-maven.iml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<module external.linked.project.id="$MODULE_DIR$/pom.xml" external.system.module.type="SINGLE_MODULE" external.system.module.version="223-2" org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$" dumb="true">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/annotations" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-test-sources/test-annotations" isTestSource="true" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-imaging:1.0-alpha2" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.0" level="project" />
</component>
</module>
26 changes: 15 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.springframework</groupId>
<artifactId>gs-maven</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -40,6 +40,19 @@
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.17.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>7.17.0</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -67,13 +80,4 @@
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.5.0</version>
</plugin>
</plugins>
</reporting>
</project>
</project>
5 changes: 0 additions & 5 deletions src/main/java/program/main/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ public String toString() {
*/
public abstract Pump otherEnd(Pump p);

/**
* A víz áramlását valósítja meg.
*/
public abstract void waterFlowing();

/**
* Beállítja, hogy a ciszternában van-e pumpa a newPump adattag értékének változtatásával.
*
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/program/main/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ public void render(Graphics g) throws InterruptedException {


if (!Controller.getCurrentTurnIsNomad()) {
if (controller.CurrentPlumberTurn() != null)
g.drawImage(controller.CurrentPlumberTurn().getPicture(), 13, 15, 50, 50, null);
} else if (controller.CurrentNomadTurn() != null)
g.drawImage(controller.CurrentNomadTurn().getPicture(), 13, 15, 50, 50, null);
if (controller.currentPlumberTurn() != null)
g.drawImage(controller.currentPlumberTurn().getPicture(), 13, 15, 50, 50, null);
} else if (controller.currentNomadTurn() != null)
g.drawImage(controller.currentNomadTurn().getPicture(), 13, 15, 50, 50, null);
}

/**
Expand All @@ -178,6 +178,7 @@ public ArrayList<Pipe> Pipes() {
return pipes;
}


/**
* Futtatja a játék fő ciklusát.
*/
Expand All @@ -189,7 +190,7 @@ public void run() {
long lastCheck = System.currentTimeMillis();
double lamdaU = 0;
double lamdaF = 0;
while (!Controller.GameOver) {
while (!Controller.gameOver) {
long currentTime = System.nanoTime();

lamdaU += (currentTime - previousTime) / timePerUpdata;
Expand All @@ -212,7 +213,7 @@ public void run() {
frames = 0;
update = 0;
}
if (controller.GameOver) {
if (controller.gameOver) {

restartmenu = new restart_menu();
try {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/program/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
*/
public class Main {


public static Game game = new Game();
/**
* a cmd ArrayListben tároljuk el a konzolról beérkezett parancsokat
*/
static ArrayList<String> cmds = new ArrayList<>();


/**
* A játékban véletlenszerű események is szerpelnek, ezeket lehet véletlenszerure,
* vagy determinisztikusra állítani a random booleannal
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/program/main/NomadButtonPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void resetTurn(boolean temp) {
*/
@Override
public void actionPerformed(ActionEvent e) {
if (!Controller.CurrentTurnIsNomad) {
if (!Controller.currentTurnIsNomad) {
//this.setVisible(false);
return;
} else {
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/program/main/NomadPipeInteraction.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,12 @@ public static boolean getendturn(){
public static void setendturn(boolean temp){
endturn = temp;
}

public Object getSlippery() {
return slippery;
}

public Object getEnd() {
return end;
}
}
2 changes: 1 addition & 1 deletion src/main/java/program/main/Pipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public ArrayList<Pump> getConnectedPumps() {
*
* @return
*/
public ArrayList<Pump> getConnectedPipes() {
public ArrayList<Pipe> getConnectedPipes() {

throw new UnsupportedOperationException("Nincs ilyen függvénye: " + "Pipe.getConnectedPipes()");
}
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/program/main/PlumberButtonPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void resetTurn(boolean temp) {
*/
@Override
public void actionPerformed(ActionEvent e) {
if (Controller.CurrentTurnIsNomad) {
if (Controller.currentTurnIsNomad) {
//this.setVisible(false);
return;
} else {
Expand Down Expand Up @@ -140,4 +140,17 @@ public void actionPerformed(ActionEvent e) {
}
Main.game.gamePanel.repaint();
}

public Object getpickupnewpipe() {
return pickupnewpipe;
}

public Object getpickUpPump() {
return pickUpPump;
}

public Object getChangePipeIn() {return changePipeIn;}

public Object getChangePipeOut() { return changePipeOut;}

}
14 changes: 14 additions & 0 deletions src/main/java/program/main/PlumberPipeInteraction.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,18 @@ public static boolean getendturn(){
public static void setendturn(boolean temp){
endturn = temp;
}

public Object getSticky() {
return sticky;
}

public Object getDestroy() {return destroy;}

public Object getRepair(){
return repair;
}

public Object getEnd() {
return end;
}
}
Loading

0 comments on commit 237f770

Please sign in to comment.