-
Notifications
You must be signed in to change notification settings - Fork 59
Refactor: Melhoria global do Puzzle do 8 [Estágio] #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0c49776
9620977
a1985b3
f9cc2f4
c73741e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eight_game/target/* |
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.
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.
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.
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding//src/main/resources=UTF-8 | ||
encoding/<project>=UTF-8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=18 | ||
org.eclipse.jdt.core.compiler.compliance=18 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 | ||
org.eclipse.jdt.core.compiler.compliance=11 | ||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled | ||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | ||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore | ||
org.eclipse.jdt.core.compiler.release=disabled | ||
org.eclipse.jdt.core.compiler.source=18 | ||
org.eclipse.jdt.core.compiler.release=enabled | ||
org.eclipse.jdt.core.compiler.source=11 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<actions> | ||
<action> | ||
<actionName>run</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>clean</goal> | ||
<goal>javafx:run</goal> | ||
</goals> | ||
</action> | ||
<action> | ||
<actionName>jlink</actionName> | ||
<goals> | ||
<goal>clean</goal> | ||
<goal>javafx:jlink</goal> | ||
</goals> | ||
</action> | ||
<action> | ||
<actionName>debug</actionName> | ||
<goals> | ||
<goal>clean</goal> | ||
<goal>javafx:run@debug</goal> | ||
</goals> | ||
<properties> | ||
<jpda.listen>true</jpda.listen> | ||
</properties> | ||
</action> | ||
</actions> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<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 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.j0suetm</groupId> | ||
<artifactId>eight_game</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.openjfx</groupId> | ||
<artifactId>javafx-controls</artifactId> | ||
<version>21-ea+17</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openjfx</groupId> | ||
<artifactId>javafx-base</artifactId> | ||
<version>21-ea+21</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openjfx</groupId> | ||
<artifactId>javafx-media</artifactId> | ||
<version>21-ea+21</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<version>5.10.0-M1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testfx</groupId> | ||
<artifactId>testfx-junit5</artifactId> | ||
<version>4.0.16-alpha</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
<configuration> | ||
<release>11</release> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.22.1</version> | ||
<configuration> | ||
<argLine> | ||
--add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED | ||
</argLine> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.openjfx</groupId> | ||
<artifactId>javafx-maven-plugin</artifactId> | ||
<version>0.0.4</version> | ||
<configuration> | ||
<mainClass>com.j0suetm.eight_game.App</mainClass> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* file: App.java | ||
* author: Josué Teodoro Moreira <[email protected]> | ||
* date: Jun 16, 2023 | ||
*/ | ||
|
||
package com.j0suetm.eight_game; | ||
|
||
import javafx.application.Application; | ||
import javafx.stage.Stage; | ||
|
||
public class App extends Application { | ||
private Game game; | ||
|
||
@Override | ||
public void start(Stage stage) { | ||
this.game = new Game("Jogo do 8 - Josué Teodoro", 600, 640, true); | ||
game.show(stage); | ||
} | ||
|
||
public static void main(String[] args) { | ||
launch(args); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/** | ||
* file: Game.java | ||
* author: Josué Teodoro Moreira <[email protected]> | ||
* date: Jun 16, 2023 | ||
*/ | ||
|
||
package com.j0suetm.eight_game; | ||
|
||
import com.j0suetm.eight_game.components.Board; | ||
import com.j0suetm.eight_game.components.RestartButton; | ||
|
||
import javafx.geometry.Point2D; | ||
import javafx.geometry.Pos; | ||
import javafx.scene.Scene; | ||
import javafx.scene.layout.StackPane; | ||
import javafx.stage.Stage; | ||
|
||
public class Game { | ||
private Board board; | ||
private String title; | ||
private Point2D size; | ||
private RestartButton restartButton; | ||
private Stage stage; | ||
private Scene scene; | ||
private StackPane stackPane; | ||
|
||
public Game(String title, int width, int height, boolean shouldShuffle) { | ||
this.title = title; | ||
this.size = new Point2D(width, height); | ||
|
||
this.board = new Board(width, height - 40, shouldShuffle); | ||
this.restartButton = new RestartButton((int)this.size.getX(), 40); | ||
this.restartButton.addEventHandler(this.board); | ||
|
||
this.stackPane = new StackPane(this.restartButton.getButton(), this.board.getGridPane()); | ||
this.stackPane.setAlignment(Pos.BOTTOM_CENTER); | ||
|
||
this.scene = new Scene(this.stackPane, this.size.getX(),this.size.getY()); | ||
} | ||
|
||
public void show(Stage stage) { | ||
this.stage = stage; | ||
this.stage.setTitle(this.title); | ||
this.stage.setScene(this.scene); | ||
this.stage.show(); | ||
} | ||
|
||
public Scene getScene() { | ||
return scene; | ||
} | ||
|
||
public void setScene(Scene scene) { | ||
this.scene = scene; | ||
} | ||
|
||
public StackPane getStackPane() { | ||
return stackPane; | ||
} | ||
|
||
public void setStackPane(StackPane stackPane) { | ||
this.stackPane = stackPane; | ||
} | ||
|
||
public Board getBoard() { | ||
return board; | ||
} | ||
|
||
public void setBoard(Board board) { | ||
this.board = board; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
public Point2D getSize() { | ||
return size; | ||
} | ||
|
||
public void setSize(Point2D size) { | ||
this.size = size; | ||
} | ||
|
||
public RestartButton getRestartButton() { | ||
return restartButton; | ||
} | ||
|
||
public void setRestartButton(RestartButton restartButton) { | ||
this.restartButton = restartButton; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ola Josue.
Veja a revisão deste pull request anterior.
#13
Obrigado por tentar resolver o desafio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eu que agradeço pela oportunidade.