Just a small UI changes. New architecture.
This commit is contained in:
+21
-5
@@ -1,6 +1,7 @@
|
||||
package gui;
|
||||
|
||||
import game.Control;
|
||||
import game.StartMode;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -9,10 +10,10 @@ public class GUI {
|
||||
|
||||
private final String title = "Conway's game if Live";
|
||||
|
||||
private final int offset = 10;
|
||||
|
||||
private final Control control;
|
||||
|
||||
private final int offset = 10;
|
||||
|
||||
private MenuWindow menuWindow;
|
||||
private GameWindow gameWindow;
|
||||
private ControlWindow controlWindow;
|
||||
@@ -22,12 +23,11 @@ public class GUI {
|
||||
}
|
||||
|
||||
public void createMenuWindow(){
|
||||
menuWindow = new MenuWindow(title, control);
|
||||
menuWindow = new MenuWindow(title, this);
|
||||
}
|
||||
|
||||
|
||||
public void createGameWindow(int cellCountX, int cellCountY, int width, int height){
|
||||
gameWindow = new GameWindow(title, control, cellCountX, cellCountY, width, height);
|
||||
gameWindow = new GameWindow(title, this, cellCountX, cellCountY, width, height);
|
||||
}
|
||||
|
||||
public void createControlWindow(){
|
||||
@@ -38,6 +38,20 @@ public class GUI {
|
||||
gameWindow.showGrid(grid);
|
||||
}
|
||||
|
||||
public void buildGameWindow(int xSize, int ySize, int cellCount, StartMode startMode){
|
||||
control.buildGameWindow(xSize, ySize, cellCount, startMode);
|
||||
}
|
||||
|
||||
public void buildControlWindow(){
|
||||
createControlWindow();
|
||||
}
|
||||
|
||||
public void setCell(int mouseX, int mouseY, boolean value){
|
||||
control.setCell(mouseX, mouseY, value);
|
||||
}
|
||||
|
||||
|
||||
//TODO: Delet this Methods. Those are shit.
|
||||
public void setVisibility(boolean value){
|
||||
controlWindow.setVisibility(value);
|
||||
}
|
||||
@@ -46,4 +60,6 @@ public class GUI {
|
||||
return controlWindow;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user