forked from FoundKeyGang/FoundKey
Merge pull request #2571 from syuilo/refactor-reversi-engine
Refactor reversi engine
This commit is contained in:
commit
2974c74b4e
1 changed files with 1 additions and 7 deletions
|
@ -205,13 +205,7 @@ export default class Reversi {
|
||||||
* 打つことができる場所を取得します
|
* 打つことができる場所を取得します
|
||||||
*/
|
*/
|
||||||
public canPutSomewhere(color: Color): number[] {
|
public canPutSomewhere(color: Color): number[] {
|
||||||
const result: number[] = [];
|
return Array.from(this.board.keys()).filter(i => this.canPut(color, i));
|
||||||
|
|
||||||
this.board.forEach((x, i) => {
|
|
||||||
if (this.canPut(color, i)) result.push(i);
|
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue