How we parse moves and make moves currently is very isolated, this can be made drastically simpler and integrated into the main architecture.
Currently, when we get the position command from UCI, we get "position [fen/startpos] [moves]" we do:
- parse the given fen or "startpos" to make a new Position object
- apply moves one by one using
MoveConversion.applyAlgebraMoves(), which returns a Position object after moves were applied
- this position is stored in the engine field
What would be better is:
- same as step 1 above
- convert all the given moves into Move objects (implement
Move.fromAlgebraicNotation())
- Use
Position.makeMove() to update the position
This approach moves away from using static isolated methods, designed only for this task and uses more general and tested methods.
How we parse moves and make moves currently is very isolated, this can be made drastically simpler and integrated into the main architecture.
Currently, when we get the position command from UCI, we get "position [fen/startpos] [moves]" we do:
MoveConversion.applyAlgebraMoves(), which returns a Position object after moves were appliedWhat would be better is:
Move.fromAlgebraicNotation())Position.makeMove()to update the positionThis approach moves away from using static isolated methods, designed only for this task and uses more general and tested methods.