Merge remote-tracking branch 'misskey-dev/develop' into io

This commit is contained in:
まっちゃとーにゅ
2024-01-23 15:39:41 +09:00
19 changed files with 269 additions and 53 deletions

View File

@@ -14,8 +14,8 @@
},
"scripts": {
"build": "node ./build.js",
"build:tsc": "npm run ts",
"tsc": "npm run ts-esm && npm run ts-dts",
"build:tsc": "npm run tsc",
"tsc": "npm run tsc-esm && npm run tsc-dts",
"tsc-esm": "tsc --outDir built/esm",
"tsc-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true",
"watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build:tsc\"",
@@ -33,8 +33,9 @@
"typescript": "5.3.3"
},
"dependencies": {
"crc-32": "1.2.2",
"esbuild": "0.19.11",
"glob": "^10.3.10"
"glob": "10.3.10"
},
"files": [
"built"

View File

@@ -3,6 +3,8 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import CRC32 from 'crc-32';
/**
* true ... 黒
* false ... 白
@@ -204,6 +206,13 @@ export class Game {
return ([] as number[]).concat(...diffVectors.map(effectsInLine));
}
public calcCrc32(): number {
return CRC32.str(JSON.stringify({
board: this.board,
turn: this.turn,
}));
}
public get isEnded(): boolean {
return this.turn === null;
}