@@ -195,7 +195,7 @@ case class Pos private (index: Int) extends AnyVal {
195
195
196
196
// NOTE - *neighbourhood
197
197
// these below only work for neighbour pos but that's probably fine as in Abalone we only move to (potentially extended) neighbourhood
198
- def dir (dir : Option [String ]): Option [Pos ] = {
198
+ def dir (dir : Option [String ]): Option [Pos ] =
199
199
dir match {
200
200
case Some (" left" ) => this .left
201
201
case Some (" downLeft" ) => this .downLeft
@@ -205,8 +205,8 @@ case class Pos private (index: Int) extends AnyVal {
205
205
case Some (" upRight" ) => this .upRight
206
206
case _ => None
207
207
}
208
- }
209
- def dir (pos : Pos ): Option [String ] = {
208
+
209
+ def dir (pos : Pos ): Option [String ] =
210
210
(pos.file.index - this .file.index, pos.rank.index - this .rank.index) match {
211
211
case (0 , 1 ) => Some (" upLeft" )
212
212
case (0 , - 1 ) => Some (" downRight" )
@@ -216,10 +216,8 @@ case class Pos private (index: Int) extends AnyVal {
216
216
case (- 1 , - 1 ) => Some (" downLeft" )
217
217
case _ => None
218
218
}
219
- }
220
- def isInLine (pos1 : Pos , pos2 : Pos ): Boolean = {
221
- this .dir(pos1) == pos1.dir(pos2)
222
- }
219
+
220
+ def isInLine (pos1 : Pos , pos2 : Pos ): Boolean = this .dir(pos1) == pos1.dir(pos2)
223
221
// *end of note about neighbourhood
224
222
225
223
@ inline def file = File of this // column (as if it was an index in a 1D array)
0 commit comments