-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Pawn rule and textual fix to Pawn specifications
- Loading branch information
1 parent
50ee6c3
commit be93e3f
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
chess/src/main/scala/io/github/chess/model/rules/pawn/PawnRule.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* MIT License | ||
* Copyright (c) 2023 Cesario Jahrim Gabriele & Derevyanchenko Maxim & Felice Mirko & Kentpayeva Madina | ||
* | ||
* Full license description available at: https://github.com/jahrim/PPS-22-chess/blob/master/LICENSE | ||
*/ | ||
package io.github.chess.model.rules.pawn | ||
|
||
import io.github.chess.model.{Move, Position} | ||
import io.github.chess.model.rules.ChessRule | ||
import io.github.chess.model.Pawn | ||
|
||
/** Implementation of the [[ChessRule]] that applies the rules of the [[Pawn]]. */ | ||
case class PawnRule() extends ChessRule: | ||
|
||
override def findMoves(position: Position): Set[Move] = | ||
ForwardOneRule().findMoves(position) ++ | ||
DoubleMoveRule().findMoves(position) |
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