Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sedeve committed Nov 14, 2023
1 parent b39f08f commit 0cd0b2d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
6 changes: 0 additions & 6 deletions backend/code/src/game/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export class Game {
p2PaddleY: number,
side: boolean,
) {

const scale = this.h / player2.h;
if (
p2PaddleY * scale - this.paddleHeight / 6 >= 0 &&
Expand Down Expand Up @@ -102,7 +101,6 @@ export class Game {
}

private down2() {

this.eventp2Paddle += this.p2Res.h / 6 / 6;
if (this.eventp2Paddle - this.p2Res.h / 6 / 6 < 0) {
this.eventp2Paddle = 0;
Expand Down Expand Up @@ -134,7 +132,6 @@ export class Game {
}

if (

this.y > this.p1PaddleY &&
this.y < this.p1PaddleY + this.paddleHeight &&
this.x >= this.w - (this.paddleWidth + this.gap + this.ballSize / 2)
Expand All @@ -145,7 +142,6 @@ export class Game {
if (
(this.y < this.p2PaddleY ||
this.y > this.p2PaddleY + this.paddleHeight) &&

this.x + this.ballSize / 2 >= this.w - (this.paddleWidth + this.gap)
) {
console.log(`${this.p1PaddleY} ${this.x} ${this.y} ${this.ballSize}`);
Expand All @@ -157,7 +153,6 @@ export class Game {
if (
(this.y < this.p1PaddleY ||
this.y > this.p1PaddleY + this.paddleHeight) &&

this.x - this.ballSize / 2 <= this.paddleWidth + this.gap
) {
console.log(`${this.p1PaddleY} ${this.x} ${this.y} ${this.ballSize}`);
Expand Down Expand Up @@ -303,7 +298,6 @@ export class Game {
this.emitGameEnd('p2 disconnected');
});
this.p1socket.on('leave', () => {

this.emitGameEnd('p1Leave');
this.p2socket.emit('win', 'you win other player leave the game');
this.p1socket.emit('lose', 'you win other player leave the game');
Expand Down
1 change: 0 additions & 1 deletion backend/code/src/gateways/gateways.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ interface GameInvite {
gameId: string;
}


@WebSocketGateway(3004, {
cors: {
origin: ['http://localhost:3001'],
Expand Down
8 changes: 4 additions & 4 deletions backend/code/src/profile/profile.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export class ProfileService {
wonMatches === 0
? null
: wonMatches >= 100
? 2
: Math.floor(Math.log10(wonMatches));
? 2
: Math.floor(Math.log10(wonMatches));

return new ProfileDto({ ...user, achievement }, false);
}
Expand Down Expand Up @@ -58,8 +58,8 @@ export class ProfileService {
wonMatches === 0
? null
: wonMatches >= 100
? 2
: Math.floor(Math.log10(wonMatches));
? 2
: Math.floor(Math.log10(wonMatches));
return new ProfileDto({ ...user, achievement }, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const InvitationWaiting = forwardRef<HTMLDialogElement, any>(
socketStore.socket.off("game.declined");
socketStore.socket.off("game.accepted");
};
//eslint-disable-next-line
}, [userStore.gameId, socketStore.socket, ref]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const InvitationGame = forwardRef<HTMLDialogElement, any>((_, ref) => {
return () => {
socketStore.socket.off("game.declined");
};
//eslint-disable-next-line
}, [userStore.inviterId, socketStore, ref]);

return (
Expand Down

0 comments on commit 0cd0b2d

Please sign in to comment.