diff --git a/AlgebraicDataflowArchitectureModel/src/application/simulator/actions/ShowGameSimulatorAction.java b/AlgebraicDataflowArchitectureModel/src/application/simulator/actions/ShowGameSimulatorAction.java new file mode 100644 index 0000000..dab89e9 --- /dev/null +++ b/AlgebraicDataflowArchitectureModel/src/application/simulator/actions/ShowGameSimulatorAction.java @@ -0,0 +1,34 @@ +package application.simulator.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; + +import application.simulator.UISimulatorWindow; +import gameEngine.views.Window; +import simulator.Simulator; +import simulator.interfaces.gameEngine.GameEnginePresenter; + +public class ShowGameSimulatorAction extends AbstractAction { + private Simulator simulator; + + public ShowGameSimulatorAction(Simulator simulator) { + super("Show Game Simulator"); + this.simulator = simulator; + } + + @Override + public void actionPerformed(ActionEvent e) { + Window window = Window.get(); + Thread game = new Thread() { + @Override + public void run() { + window.init(); + GameEnginePresenter presenter = new GameEnginePresenter(window.getScene(), simulator); + window.run(); + } + }; + game.start(); + } + +}