Add abstract method updateStatus to renderer
This commit is contained in:
@@ -45,4 +45,10 @@ public class ConsoleRenderer extends GomokuRenderer {
|
||||
sb.append("+");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(String status) {
|
||||
// Print the status to the console
|
||||
System.out.println("Status: " + status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,5 @@ public abstract class GomokuRenderer {
|
||||
|
||||
public abstract void init(GomokuGame game);
|
||||
public abstract void update();
|
||||
public abstract void updateStatus(String status);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ public class SwingRenderer extends GomokuRenderer {
|
||||
canvas.draw(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(String status) {
|
||||
// Update the status label
|
||||
JLabel statusLabel = (JLabel) mainFrame.getContentPane().getComponent(1);
|
||||
|
||||
Reference in New Issue
Block a user