-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
736 additions
and
373 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
25 changes: 10 additions & 15 deletions
25
src/main/scala/scatan/controllers/game/SetUpController.scala
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 |
---|---|---|
@@ -1,26 +1,21 @@ | ||
package scatan.controllers.game | ||
|
||
import scatan.lib.mvc.{BaseController, Controller} | ||
import scatan.lib.mvc.{Controller, EmptyController} | ||
import scatan.model.ApplicationState | ||
import scatan.views.game.SetUpView | ||
|
||
/** This is the controller for the setup page. | ||
/** The controller for the game setup screen. | ||
*/ | ||
trait SetUpController extends Controller[ApplicationState]: | ||
|
||
/** Starts the game with the given usernames. | ||
* @param usernames, | ||
* the usernames of the players. | ||
*/ | ||
def startGame(usernames: String*): Unit | ||
|
||
object SetUpController: | ||
def apply(requirements: Controller.Requirements[SetUpView, ApplicationState]): SetUpController = | ||
SetUpControllerImpl(requirements) | ||
|
||
/** This is the implementation of the controller for the setup page. | ||
* @param requirements, | ||
* the requirements for the controller. | ||
*/ | ||
private class SetUpControllerImpl(requirements: Controller.Requirements[SetUpView, ApplicationState]) | ||
extends BaseController(requirements) | ||
with SetUpController: | ||
|
||
override def startGame(usernames: String*): Unit = | ||
this.model | ||
.update(_.createGame(usernames*)) | ||
new EmptyController(requirements) with SetUpController: | ||
override def startGame(usernames: String*): Unit = | ||
this.model.update(_.createGame(usernames*)) |
10 changes: 4 additions & 6 deletions
10
src/main/scala/scatan/controllers/home/AboutController.scala
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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
package scatan.controllers.home | ||
|
||
import scatan.lib.mvc.{BaseController, Controller} | ||
import scatan.lib.mvc.{Controller, EmptyController} | ||
import scatan.model.ApplicationState | ||
import scatan.views.home.AboutView | ||
|
||
/** The about page controller. | ||
*/ | ||
trait AboutController extends Controller[ApplicationState] | ||
|
||
object AboutController: | ||
def apply(requirements: Controller.Requirements[AboutView, ApplicationState]): AboutController = | ||
AboutControllerImpl(requirements) | ||
|
||
private class AboutControllerImpl(requirements: Controller.Requirements[AboutView, ApplicationState]) | ||
extends BaseController(requirements) | ||
with AboutController | ||
new EmptyController(requirements) with AboutController |
14 changes: 3 additions & 11 deletions
14
src/main/scala/scatan/controllers/home/HomeController.scala
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 |
---|---|---|
@@ -1,21 +1,13 @@ | ||
package scatan.controllers.home | ||
|
||
import scatan.lib.mvc.{BaseController, Controller} | ||
import scatan.lib.mvc.{Controller, EmptyController} | ||
import scatan.model.ApplicationState | ||
import scatan.views.home.HomeView | ||
|
||
/** This is the controller for the home page. | ||
/** The home page controller. | ||
*/ | ||
trait HomeController extends Controller[ApplicationState] | ||
|
||
object HomeController: | ||
def apply(requirements: Controller.Requirements[HomeView, ApplicationState]): HomeController = | ||
HomeControllerImpl(requirements) | ||
|
||
/** This is the implementation of the controller for the home page. | ||
* @param requirements, | ||
* the requirements for the controller. | ||
*/ | ||
class HomeControllerImpl(requirements: Controller.Requirements[HomeView, ApplicationState]) | ||
extends BaseController(requirements) | ||
with HomeController | ||
new EmptyController(requirements) with HomeController |
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 was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.