-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: DonatJR <[email protected]>
- Loading branch information
Showing
4 changed files
with
94 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package de.htwg.se.sudoku.aview | ||
|
||
import akka.actor.Actor | ||
import de.htwg.se.sudoku.aview.UiMessage.{Crash, CreateGui, CreateTui} | ||
import de.htwg.se.sudoku.aview.gui.SwingGui | ||
|
||
case class UiFactory() extends Actor { | ||
|
||
override def receive: Receive = { | ||
|
||
case CreateGui(controller) => new SwingGui(controller) | ||
case CreateTui(controller) => | ||
val tui = new Tui(controller) | ||
sender ! tui | ||
case Crash => throw new NullPointerException() // actor gets restarted by default | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package de.htwg.se.sudoku.aview | ||
|
||
import de.htwg.se.sudoku.controller.controllerComponent.ControllerInterface | ||
|
||
object UiMessage { | ||
case class CreateGui(controller: ControllerInterface) | ||
case class CreateTui(controller: ControllerInterface) | ||
case class Crash() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters