You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.01-QCM_MuscuMaths/Website/class/Lobby.php

53 lines
965 B

<?php
class Lobby
{
private int $id;
private string $name;
private string $password;
private int $nbPlayer;
public function __construct(int $id, string $name, string $password, int $nbPlayer)
{
$this->id = $id;
$this->name = $name;
$this->password = $password;
$this->nbPlayer = $nbPlayer;
}
public function getName()
{
return $this->name;
}
public function getNbPlayer()
{
return $this->nbPlayer;
}
public function setNbplayer(int $nbPlayer)
{
$this->nbPlayer = $nbPlayer;
}
public function addPlayer(int $number)
{
$this->nbPlayer = $this->nbPlayer + $number ;
}
public function removePlayer(int $number)
{
$this->nbPlayer = $this->nbPlayer - $number ;
}
public function getPassword()
{
return $this->password;
}
public function idEqual($idTest)
{
return $this->id == $idTest ;
}
}