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 { type PongService } from '../pong.service'
import { import {
DEFAULT_BALL_SIZE, DEFAULT_BALL_SIZE,
DEFAULT_MAP_SIZE,
DEFAULT_PADDLE_SIZE, DEFAULT_PADDLE_SIZE,
DEFAULT_PLAYER_X_OFFSET, DEFAULT_PLAYER_X_OFFSET,
DEFAULT_WIN_SCORE DEFAULT_WIN_SCORE
@ -23,7 +24,10 @@ export class Games {
gameCreationDto: GameCreationDtoValidated gameCreationDto: GameCreationDtoValidated
): void { ): void {
const names: string[] = gameCreationDto.playerNames 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])) { if (!this.isInAGame(names[0]) && !this.isInAGame(names[1])) {
this.games.push( this.games.push(
new Game( new Game(

Loading…
Cancel
Save