feat(ui): added rules

added /rules to webui
This commit is contained in:
LQ63
2025-10-23 09:32:24 +02:00
parent c168ae7dc0
commit 9d8f597792
4 changed files with 73 additions and 1 deletions

View File

@@ -41,7 +41,11 @@ class HomeController @Inject()(val controllerComponents: ControllerComponents) e
Redirect("/sessions") Redirect("/sessions")
} }
} }
def rules(): Action[AnyContent] = {
Action { implicit request =>
Ok(views.html.rules.apply())
}
}
def sessions(): Action[AnyContent] = { def sessions(): Action[AnyContent] = {
Action { implicit request => Action { implicit request =>
Ok(views.html.sessions.apply(PodGameManager.listSessions())) Ok(views.html.sessions.apply(PodGameManager.listSessions()))

View File

@@ -110,6 +110,11 @@
align-items: center; align-items: center;
height: 100%; height: 100%;
} }
#rules {
color: white;
font-size: 1.5em;
font-family: Arial;
}
</style> </style>
</head> </head>

View File

@@ -0,0 +1,61 @@
@()
@main("Rules") {
<div id="rules">
<table>
<caption>Rules Overview and Equipment</caption>
<thead>
<tr>
<th>Section</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr>
<td>Players</td>
<td>Two to seven players. The aim is to be the last player left in the game.</td>
</tr>
<tr>
<td>Aim</td>
<td>To be the last player left in at the end of the game, with the object in each hand being to win a majority of tricks.</td>
</tr>
<tr>
<td>Equipment</td>
<td>A standard 52-card pack is used.</td>
</tr>
<tr>
<td>Card Ranks</td>
<td>In each suit, cards rank from highest to lowest: A K Q J 10 9 8 7 6 5 4 3 2.</td>
</tr>
<tr>
<td>Deal (First Hand)</td>
<td>The dealer deals seven cards to each player. One card is turned up to determine the trump suit for the round.</td>
</tr>
<tr>
<td>Deal (Subsequent Hands)</td>
<td>The deal rotates clockwise. The player who took the most tricks in the previous hand selects the trump suit. If there's a tie for the highest number of tricks, players cut cards to decide who calls trumps. One fewer card is dealt in each successive hand until the final hand consists of one card each.</td>
</tr>
<tr>
<td>Play</td>
<td>The player to the dealer's left (eldest hand) leads the first trick. Any card can be led. Other players must follow suit if possible. A player with no cards of the suit led may play any card.</td>
</tr>
<tr>
<td>Winning a Trick</td>
<td>The highest card of the suit led wins, unless a trump is played, in which case the highest trump wins. The winner of the trick leads the next.</td>
</tr>
<tr>
<td>Leading Trumps</td>
<td>Some rules disallow leading trumps before the suit has been 'broken' (a trump has been played to the lead of another suit). Leading trumps is always permissible if a player holds only trumps.</td>
</tr>
<tr>
<td>Knockout</td>
<td>At the end of each hand, any player who took no tricks is knocked out and takes no further part in the game.</td>
</tr>
<tr>
<td>Winning the Game</td>
<td>The game is won when a player takes all the tricks in a round, as all other players are knocked out, leaving only one player remaining.</td>
</tr>
</tbody>
</table>
</div>
}

View File

@@ -10,3 +10,5 @@ GET /sessions controllers.HomeController.sessions()
GET /ingame/:id controllers.HomeController.ingame(id: String) GET /ingame/:id controllers.HomeController.ingame(id: String)
# Map static resources from the /public folder to the /assets URL path # Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset) GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
GET /rules controllers.HomeController.rules()