1
0
forked from noxious/server

New method for events + TP work

This commit is contained in:
2024-08-26 19:09:35 +02:00
parent ea9639b440
commit e8d100e063
15 changed files with 282 additions and 190 deletions

View File

@ -0,0 +1,25 @@
class Rotation {
static calculate(X1: number, Y1: number, X2: number, Y2: number): number {
let rotation = 0
if (X1 > X2 && Y1 > Y2) {
rotation = 7
} else if (X1 < X2 && Y1 < Y2) {
rotation = 3
} else if (X1 > X2 && Y1 < Y2) {
rotation = 5
} else if (X1 < X2 && Y1 > Y2) {
rotation = 1
} else if (X1 > X2) {
rotation = 6
} else if (X1 < X2) {
rotation = 2
} else if (Y1 < Y2) {
rotation = 4
} else if (Y1 > Y2) {
rotation = 0
}
return rotation
}
}
export default Rotation