1
0
forked from noxious/server
This commit is contained in:
2024-08-22 20:00:37 +02:00
parent ff7664bae0
commit c4b50ec811
16 changed files with 97 additions and 80 deletions

View File

@ -12,9 +12,9 @@ const logger = pino({
formatters: {
level: (label) => {
return { level: label.toUpperCase() }
},
}
},
timestamp: pino.stdTimeFunctions.isoTime
})
export default logger
export default logger

View File

@ -4,9 +4,9 @@ export type Node = Position & { parent?: Node; g: number; h: number; f: number }
export class AStar {
private static readonly DIRECTIONS = [
{ x: 0, y: -1 }, // Up
{ x: 0, y: 1 }, // Down
{ x: 0, y: 1 }, // Down
{ x: -1, y: 0 }, // Left
{ x: 1, y: 0 }, // Right
{ x: 1, y: 0 }, // Right
{ x: -1, y: -1 },
{ x: -1, y: 1 },
{ x: 1, y: -1 },