Created
July 16, 2017 23:18
-
-
Save JeffML/54598c92775415e2457a48926d6be761 to your computer and use it in GitHub Desktop.
Second legalMoves service
This file contains hidden or 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
this.add('role:movement,cmd:legalMoves', function (msg, reply) { | |
this.prior(msg, function (err, result) { | |
if (msg.board) { | |
const result2 = legalMovesWithBoard(msg, result); | |
if (msg.piece.piece === 'K') { | |
legalMovesWithKing.call(this, msg, result2, reply) | |
} else { | |
reply(err, result2); | |
} | |
} else { | |
reply(err, result); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment