import { ArrayFun } from "@/utils/array";
import { randInt, shuffle } from "@/utils/alea";
+// class "PiPo": Piece + Position
export const PiPo = class PiPo {
- //Piece+Position
// o: {piece[p], color[c], posX[x], posY[y]}
constructor(o) {
this.p = o.p;
}
};
-// TODO: for animation, moves should contains "moving" and "fading" maybe...
export const Move = class Move {
// o: {appear, vanish, [start,] [end,]}
// appear,vanish = arrays of PiPo
//////////////
// MISC UTILS
+ // Some variants don't have flags:
static get HasFlags() {
return true;
- } //some variants don't have flags
+ }
+ // Some variants don't have en-passant
static get HasEnpassant() {
return true;
- } //some variants don't have ep.
+ }
+
+ // Some variants cannot have analyse mode
+ static get CanAnalyze() {
+ return true;
+ }
+
+ // Some variants show incomplete information,
+ // and thus show only a partial moves list or no list at all.
+ static get ShowMoves() {
+ return "all";
+ }
// Path to pieces
static getPpath(b) {