Removed TSC in favour of node's own Typescript exec.

This commit is contained in:
2025-02-07 22:27:19 +01:00
parent 52b8a9b7ad
commit cff5fed4f7
19 changed files with 2300 additions and 167 deletions

View File

@ -140,8 +140,8 @@ class CharacterMoveService extends BaseService {
}
private getDistance(a: Position, b: Position): number {
const dx = Math.abs(a.positionX - b.positionX),
dy = Math.abs(a.positionY - b.positionY)
const dx = Math.abs(a.positionX - b.positionX)
const dy = Math.abs(a.positionY - b.positionY)
// Manhattan distance for straight paths, then Euclidean for diagonals
return dx + dy + (Math.sqrt(2) - 2) * Math.min(dx, dy)
}