mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Enforced singleton pattern in FControl.
This commit is contained in:
@@ -39,7 +39,10 @@ import forge.control.KeyboardShortcuts.Shortcut;
|
||||
* between various display states in that JFrame. Controllers are instantiated
|
||||
* separately by each state's top level view class.
|
||||
*/
|
||||
public final class FControl {
|
||||
public enum FControl {
|
||||
/** */
|
||||
SINGLETON_INSTANCE;
|
||||
|
||||
private List<Shortcut> shortcuts;
|
||||
private JLayeredPane display;
|
||||
private int state;
|
||||
@@ -63,7 +66,7 @@ public final class FControl {
|
||||
* switches between various display states in that JFrame. Controllers are
|
||||
* instantiated separately by each state's top level view class.
|
||||
*/
|
||||
public FControl() {
|
||||
private FControl() {
|
||||
// "Close" button override during match
|
||||
this.waConcede = new WindowAdapter() {
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,7 @@ public final class Main {
|
||||
try {
|
||||
final FModel model = new FModel();
|
||||
final FView view = new FView();
|
||||
final FControl control = new FControl();
|
||||
final FControl control = FControl.SINGLETON_INSTANCE;
|
||||
|
||||
Singletons.setModel(model);
|
||||
Singletons.setView(view);
|
||||
|
||||
Reference in New Issue
Block a user