Skip to content
Snippets Groups Projects
Commit 8b8dd77b authored by Yanis O's avatar Yanis O
Browse files

[Fix] getImage utilise une version statique de l'image plutôt que d'en créer une nouvelle

parent 0e6bc285
Branches
No related tags found
No related merge requests found
Pipeline #40646 failed
......@@ -17,8 +17,15 @@ public class Cloud implements Entity{
private final Color viewColor = Color.GRAY;
private final int priority = 2;
private static javafx.scene.image.Image cloudImage;
static {
try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/nuage.png").toExternalForm());
} catch (Exception e) {
e.printStackTrace();
}
}
public Cloud(Position position, Board<Square> b){
this.age = 0;
this.position = position;
......@@ -110,7 +117,7 @@ public class Cloud implements Entity{
public javafx.scene.image.Image getImage() {
return new javafx.scene.image.Image(getClass().getResource("/icons/img.png").toExternalForm());
return cloudImage;
}
......
src/main/resources/view/nuage.png

64.3 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment