projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Avalanche, write Avalam rules
[xogo.git]
/
base_rules.js
diff --git
a/base_rules.js
b/base_rules.js
index
01a2c24
..
8eed3d3
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-2420,7
+2420,11
@@
export default class ChessRules {
}
// What is the score ? (Interesting if game is over)
}
// What is the score ? (Interesting if game is over)
- getCurrentScore(move) {
+ getCurrentScore(move_s) {
+ const move = move_s[move_s.length - 1];
+ // Shortcut in case the score was computed before:
+ if (move.result)
+ return move.result;
const color = this.turn;
const oppCol = C.GetOppCol(color);
const kingPos = {
const color = this.turn;
const oppCol = C.GetOppCol(color);
const kingPos = {