mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 05:23:08 +02:00
Refactor reversi engine
This commit is contained in:
parent
4a977cd523
commit
3d24112d2d
1 changed files with 1 additions and 7 deletions
|
@ -205,13 +205,7 @@ export default class Reversi {
|
|||
* 打つことができる場所を取得します
|
||||
*/
|
||||
public canPutSomewhere(color: Color): number[] {
|
||||
const result: number[] = [];
|
||||
|
||||
this.board.forEach((x, i) => {
|
||||
if (this.canPut(color, i)) result.push(i);
|
||||
});
|
||||
|
||||
return result;
|
||||
return Array.from(this.board.keys()).filter(i => this.canPut(color, i));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue