-
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.
Merge pull request #50 from zucchero-sintattico/feature-cleanup
Feature cleanup
- Loading branch information
Showing
89 changed files
with
1,900 additions
and
749 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
28 changes: 13 additions & 15 deletions
28
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,24 @@ | ||
package scatan.controllers.game | ||
|
||
import scatan.lib.mvc.{BaseController, Controller} | ||
import scatan.lib.mvc.{Controller, EmptyController} | ||
import scatan.model.ApplicationState | ||
import scatan.model.map.GameMap | ||
import scatan.views.game.SetUpView | ||
import scatan.model.GameMap | ||
|
||
/** 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 gameMap, | ||
* the game map to use. | ||
* @param usernames, | ||
* the usernames of the players. | ||
*/ | ||
def startGame(gameMap: GameMap, 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(gameMap: GameMap, usernames: String*): Unit = | ||
this.model.update(_.createGame(gameMap, usernames*)) | ||
new EmptyController(requirements) with SetUpController: | ||
override def startGame(gameMap: GameMap, usernames: String*): Unit = | ||
this.model.update(_.createGame(gameMap, usernames*)) |
11 changes: 4 additions & 7 deletions
11
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,16 +1,13 @@ | ||
package scatan.controllers.home | ||
|
||
import scatan.Pages | ||
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 |
15 changes: 3 additions & 12 deletions
15
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,22 +1,13 @@ | ||
package scatan.controllers.home | ||
|
||
import scatan.Pages | ||
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 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.