yep
This commit is contained in:
@@ -31,25 +31,21 @@
|
||||
|
||||
public MoveResult CanMove(string from, string to, bool isPromotion)
|
||||
{
|
||||
// TODO: ShogiBoardState.FromBoardNotation should not throw an execption in this query method.
|
||||
var fromVector = ShogiBoardState.FromBoardNotation(from);
|
||||
var toVector = ShogiBoardState.FromBoardNotation(to);
|
||||
var simulator = new StandardRules(new ShogiBoardState(board));
|
||||
return simulator.Move(fromVector, toVector, isPromotion);
|
||||
return simulator.Move(from, to, isPromotion);
|
||||
}
|
||||
|
||||
public MoveResult CanMove(WhichPiece pieceInHand, string to)
|
||||
{
|
||||
var toVector = ShogiBoardState.FromBoardNotation(to);
|
||||
var simulator = new StandardRules(new ShogiBoardState(board));
|
||||
return simulator.Move(pieceInHand, toVector);
|
||||
return simulator.Move(pieceInHand, to);
|
||||
}
|
||||
|
||||
public void Move(string from, string to, bool isPromotion)
|
||||
{
|
||||
var fromVector = ShogiBoardState.FromBoardNotation(from);
|
||||
var toVector = ShogiBoardState.FromBoardNotation(to);
|
||||
var moveResult = rules.Move(fromVector, toVector, isPromotion);
|
||||
var moveResult = rules.Move(from, to, isPromotion);
|
||||
if (!moveResult.Success)
|
||||
{
|
||||
throw new InvalidOperationException(moveResult.Reason);
|
||||
|
||||
Reference in New Issue
Block a user