Browse Source

* Removed map size in game creation in backend

master
vvandenb 2 years ago
parent
commit
7b66e5612a
  1. 6
      back/volume/src/pong/game/Games.ts

6
back/volume/src/pong/game/Games.ts

@ -7,6 +7,7 @@ import { type GameInfo } from '../dtos/GameInfo'
import { type PongService } from '../pong.service'
import {
DEFAULT_BALL_SIZE,
DEFAULT_MAP_SIZE,
DEFAULT_PADDLE_SIZE,
DEFAULT_PLAYER_X_OFFSET,
DEFAULT_WIN_SCORE
@ -23,7 +24,10 @@ export class Games {
gameCreationDto: GameCreationDtoValidated
): void {
const names: string[] = gameCreationDto.playerNames
const map: GameMap = gameCreationDto.map
const map: GameMap = {
size: DEFAULT_MAP_SIZE,
walls: gameCreationDto.map.walls
}
if (!this.isInAGame(names[0]) && !this.isInAGame(names[1])) {
this.games.push(
new Game(

Loading…
Cancel
Save