diff --git a/src/main/java/model/automata/GameOfLifeState.java b/src/main/java/model/automata/GameOfLifeState.java index 74a2a5475ed333502d92c46e91da985a84d1ad25..e47516c152a2e06c7b083dd4028229bd0a103a83 100644 --- a/src/main/java/model/automata/GameOfLifeState.java +++ b/src/main/java/model/automata/GameOfLifeState.java @@ -14,15 +14,23 @@ public enum GameOfLifeState implements State<GameOfLifeState> { @Override public Color getColor() { - switch(this) { + switch (this) { case ALIVE: return Color.RED; - case DEAD : + case DEAD: + return Color.WHITE; + default: return Color.WHITE; - default : return Color.WHITE; } } + /* correction avec if : + if this.equals(ALIVE) { + return COLOR.RED; + else { + return COLOR.WHITE; + */ + @Override public GameOfLifeState next() { switch (this) { @@ -30,9 +38,16 @@ public enum GameOfLifeState implements State<GameOfLifeState> { return DEAD; case DEAD: return ALIVE; - default : return DEAD; + default: + return DEAD; } } + /* correction avec if : + if this.equals(ALIVE) { + return DEAD; + else { + return ALIVE; + */ @Override public GameOfLifeState update(List<GameOfLifeState> neighbours) { @@ -54,4 +69,3 @@ public enum GameOfLifeState implements State<GameOfLifeState> { return DEAD; } } -