Skip to content
Snippets Groups Projects
Commit f360ed24 authored by melizzzz's avatar melizzzz
Browse files

icones virus et pierre feuille ciseau

parent 47fc6b75
No related branches found
No related tags found
No related merge requests found
Pipeline #41171 passed
Showing
with 171 additions and 48 deletions
...@@ -17,7 +17,7 @@ public class EmptySquare implements Entity { ...@@ -17,7 +17,7 @@ public class EmptySquare implements Entity {
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/img.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/img.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -15,7 +15,7 @@ public class Road implements Entity{ ...@@ -15,7 +15,7 @@ public class Road implements Entity{
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/route.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/route.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -10,6 +10,7 @@ import javafx.scene.paint.Color; ...@@ -10,6 +10,7 @@ import javafx.scene.paint.Color;
import model.Board; import model.Board;
import model.Entity; import model.Entity;
import model.Square; import model.Square;
import model.firefighterscenario.Cloud;
import util.Position; import util.Position;
import util.PositionUtil; import util.PositionUtil;
...@@ -18,6 +19,15 @@ public class Doctor implements Entity { ...@@ -18,6 +19,15 @@ public class Doctor implements Entity {
private Position position; private Position position;
private int age; private int age;
private final Color viewColor = Color.RED; private final Color viewColor = Color.RED;
private static javafx.scene.image.Image cloudImage;
static {
try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/virus/docteur.png").toExternalForm());
} catch (Exception e) {
e.printStackTrace();
}
}
// Statique car les médecins partagent les connaissances et les recherches // Statique car les médecins partagent les connaissances et les recherches
private static List<Integer> knownVirusVariant = new ArrayList<Integer>(); private static List<Integer> knownVirusVariant = new ArrayList<Integer>();
...@@ -152,4 +162,10 @@ public class Doctor implements Entity { ...@@ -152,4 +162,10 @@ public class Doctor implements Entity {
return Objects.hash(position); return Objects.hash(position);
} }
@Override
public javafx.scene.image.Image getImage() {
return cloudImage;
}
} }
...@@ -13,6 +13,8 @@ import model.Scenario; ...@@ -13,6 +13,8 @@ import model.Scenario;
import model.Square; import model.Square;
import util.Position; import util.Position;
public class DoctorVirusPatientScenario extends Scenario implements Model{ public class DoctorVirusPatientScenario extends Scenario implements Model{
public DoctorVirusPatientScenario(int columns, int rows, Map<EntityFactory, Integer> initialMap) { public DoctorVirusPatientScenario(int columns, int rows, Map<EntityFactory, Integer> initialMap) {
super(columns, rows, initialMap); super(columns, rows, initialMap);
...@@ -52,4 +54,7 @@ public class DoctorVirusPatientScenario extends Scenario implements Model{ ...@@ -52,4 +54,7 @@ public class DoctorVirusPatientScenario extends Scenario implements Model{
} }
} }
...@@ -9,6 +9,7 @@ import javafx.scene.paint.Color; ...@@ -9,6 +9,7 @@ import javafx.scene.paint.Color;
import model.Board; import model.Board;
import model.Entity; import model.Entity;
import model.Square; import model.Square;
import model.firefighterscenario.Cloud;
import util.PathGenerator; import util.PathGenerator;
import util.Position; import util.Position;
import util.PositionUtil; import util.PositionUtil;
...@@ -26,11 +27,36 @@ public class Patient implements Entity { ...@@ -26,11 +27,36 @@ public class Patient implements Entity {
private boolean isAsymptomatic; private boolean isAsymptomatic;
private boolean wandering; private boolean wandering;
private static javafx.scene.image.Image healthyImage;
private static javafx.scene.image.Image infectedImage;
static {
try {
healthyImage = new javafx.scene.image.Image(Patient.class.getResource("/view/icons/virus/humain.png").toExternalForm());
infectedImage = new javafx.scene.image.Image(Patient.class.getResource("/view/icons/virus/patient.png").toExternalForm());
} catch (Exception e) {
e.printStackTrace();
}
}
// Attributs pour le chemin // Attributs pour le chemin
private List<Position> path; private List<Position> path;
private int pathIndex; private int pathIndex;
private static final int MAX_STEPS_IN_DIRECTION = 5; private static final int MAX_STEPS_IN_DIRECTION = 5;
private static final int MINIMUM_ROAD_LENGTH = 10; private static final int MINIMUM_ROAD_LENGTH = 10;
private static javafx.scene.image.Image cloudImage;
static {
try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/virus/humain.png").toExternalForm());
} catch (Exception e) {
e.printStackTrace();
}
}
public Patient(Position p) { public Patient(Position p) {
this.wandering = true; this.wandering = true;
...@@ -321,4 +347,11 @@ public class Patient implements Entity { ...@@ -321,4 +347,11 @@ public class Patient implements Entity {
public int hashCode() { public int hashCode() {
return Objects.hash(patientID); return Objects.hash(patientID);
} }
@Override
public javafx.scene.image.Image getImage() {
return isInfected() ? infectedImage : healthyImage;
}
} }
...@@ -8,6 +8,7 @@ import javafx.scene.paint.Color; ...@@ -8,6 +8,7 @@ import javafx.scene.paint.Color;
import model.Board; import model.Board;
import model.Entity; import model.Entity;
import model.Square; import model.Square;
import model.firefighterscenario.Cloud;
import util.PathGenerator; import util.PathGenerator;
import util.Position; import util.Position;
import util.PositionUtil; import util.PositionUtil;
...@@ -23,6 +24,15 @@ public class Virus implements Entity { ...@@ -23,6 +24,15 @@ public class Virus implements Entity {
private static final int MINIMUM_ROAD_LENGTH = 10; private static final int MINIMUM_ROAD_LENGTH = 10;
private int health; private int health;
private int variantId; private int variantId;
private static javafx.scene.image.Image cloudImage;
static {
try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/virus/virus.png").toExternalForm());
} catch (Exception e) {
e.printStackTrace();
}
}
public Virus(Position p) { public Virus(Position p) {
this.variantId = 0; this.variantId = 0;
...@@ -146,4 +156,11 @@ public class Virus implements Entity { ...@@ -146,4 +156,11 @@ public class Virus implements Entity {
health--; health--;
return false; return false;
} }
@Override
public javafx.scene.image.Image getImage() {
return cloudImage;
}
} }
...@@ -22,7 +22,7 @@ public class AirTanker implements Entity{ ...@@ -22,7 +22,7 @@ public class AirTanker implements Entity{
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/avion.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/avion.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -21,7 +21,7 @@ public class Cloud implements Entity{ ...@@ -21,7 +21,7 @@ public class Cloud implements Entity{
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/nuage.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/nuage.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -23,7 +23,7 @@ public class Fire implements Entity { ...@@ -23,7 +23,7 @@ public class Fire implements Entity {
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/flamme.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/flamme.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -23,7 +23,7 @@ public class FireFighter implements Entity { ...@@ -23,7 +23,7 @@ public class FireFighter implements Entity {
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/sapeur-pompier.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/sapeur-pompier.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -16,7 +16,7 @@ public class MotorizedFireFighter extends FireFighter { ...@@ -16,7 +16,7 @@ public class MotorizedFireFighter extends FireFighter {
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/camion.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/camion.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -17,7 +17,7 @@ public class Mountain implements Entity{ ...@@ -17,7 +17,7 @@ public class Mountain implements Entity{
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/montagne.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/montagne.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -19,7 +19,7 @@ public class Rockery implements Entity{ ...@@ -19,7 +19,7 @@ public class Rockery implements Entity{
static { static {
try { try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/rochers.png").toExternalForm()); cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/fire/rochers.png").toExternalForm());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -8,6 +8,7 @@ import javafx.scene.paint.Color; ...@@ -8,6 +8,7 @@ import javafx.scene.paint.Color;
import model.Board; import model.Board;
import model.Entity; import model.Entity;
import model.Square; import model.Square;
import model.firefighterscenario.Cloud;
import util.Position; import util.Position;
import util.PositionUtil; import util.PositionUtil;
...@@ -16,6 +17,15 @@ public class Cisor implements Entity { ...@@ -16,6 +17,15 @@ public class Cisor implements Entity {
Position position; Position position;
private int age; private int age;
private final Color viewColor = Color.RED; private final Color viewColor = Color.RED;
private static javafx.scene.image.Image cloudImage;
static {
try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/pfc/cis.png").toExternalForm());
} catch (Exception e) {
e.printStackTrace();
}
}
public Cisor(Position p) { public Cisor(Position p) {
this.position = p; this.position = p;
...@@ -121,4 +131,10 @@ public class Cisor implements Entity { ...@@ -121,4 +131,10 @@ public class Cisor implements Entity {
public int hashCode() { public int hashCode() {
return Objects.hash(position, age); return Objects.hash(position, age);
} }
@Override
public javafx.scene.image.Image getImage() {
return cloudImage;
}
} }
...@@ -7,6 +7,7 @@ import javafx.scene.paint.Color; ...@@ -7,6 +7,7 @@ import javafx.scene.paint.Color;
import model.Board; import model.Board;
import model.Entity; import model.Entity;
import model.Square; import model.Square;
import model.firefighterscenario.Cloud;
import util.Position; import util.Position;
import util.PositionUtil; import util.PositionUtil;
...@@ -15,6 +16,15 @@ public class Paper implements Entity { ...@@ -15,6 +16,15 @@ public class Paper implements Entity {
Position position; Position position;
private int age; private int age;
private final Color viewColor = Color.GRAY; private final Color viewColor = Color.GRAY;
private static javafx.scene.image.Image cloudImage;
static {
try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/pfc/paper.png").toExternalForm());
} catch (Exception e) {
e.printStackTrace();
}
}
public Paper(Position p) { public Paper(Position p) {
this.position = p; this.position = p;
...@@ -103,4 +113,10 @@ public class Paper implements Entity { ...@@ -103,4 +113,10 @@ public class Paper implements Entity {
public int getPriority() { public int getPriority() {
return this.priority; return this.priority;
} }
@Override
public javafx.scene.image.Image getImage() {
return cloudImage;
}
} }
...@@ -7,6 +7,7 @@ import javafx.scene.paint.Color; ...@@ -7,6 +7,7 @@ import javafx.scene.paint.Color;
import model.Board; import model.Board;
import model.Entity; import model.Entity;
import model.Square; import model.Square;
import model.firefighterscenario.Cloud;
import util.Position; import util.Position;
import util.PositionUtil; import util.PositionUtil;
...@@ -15,6 +16,15 @@ public class Rock implements Entity { ...@@ -15,6 +16,15 @@ public class Rock implements Entity {
Position position; Position position;
private int age; private int age;
private final Color viewColor = Color.CHOCOLATE; private final Color viewColor = Color.CHOCOLATE;
private static javafx.scene.image.Image cloudImage;
static {
try {
cloudImage = new javafx.scene.image.Image(Cloud.class.getResource("/view/icons/pfc/rock.png").toExternalForm());
} catch (Exception e) {
e.printStackTrace();
}
}
public Rock(Position p) { public Rock(Position p) {
this.position = p; this.position = p;
...@@ -104,4 +114,10 @@ public class Rock implements Entity { ...@@ -104,4 +114,10 @@ public class Rock implements Entity {
public int getPriority() { public int getPriority() {
return this.priority; return this.priority;
} }
@Override
public javafx.scene.image.Image getImage() {
return cloudImage;
}
} }
...@@ -48,4 +48,8 @@ public class RockPaperCisorScenario extends Scenario implements Model{ ...@@ -48,4 +48,8 @@ public class RockPaperCisorScenario extends Scenario implements Model{
public Board<Square> getBoard() { public Board<Square> getBoard() {
return this; return this;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment