mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-04 21:53:07 +02:00
Fix #1218
This commit is contained in:
parent
6e1a821e1c
commit
859ea79f31
1 changed files with 2 additions and 2 deletions
|
@ -81,12 +81,12 @@ export default class Othello {
|
||||||
|
|
||||||
public transformPosToXy(pos: number): number[] {
|
public transformPosToXy(pos: number): number[] {
|
||||||
const x = pos % this.mapWidth;
|
const x = pos % this.mapWidth;
|
||||||
const y = Math.floor(pos / this.mapHeight);
|
const y = Math.floor(pos / this.mapWidth);
|
||||||
return [x, y];
|
return [x, y];
|
||||||
}
|
}
|
||||||
|
|
||||||
public transformXyToPos(x: number, y: number): number {
|
public transformXyToPos(x: number, y: number): number {
|
||||||
return x + (y * this.mapHeight);
|
return x + (y * this.mapWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue