2019-02-11 16:43:36 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2019-06-19 19:49:39 +02:00
|
|
|
* Class Pairing
|
|
|
|
*
|
|
|
|
* Class for a pairing of the tournament
|
|
|
|
*
|
|
|
|
* @author Jeroen De Meerleer <schaak@jeroened.be>
|
|
|
|
* @category Main
|
|
|
|
* @package Libpairtwo
|
|
|
|
* @copyright Copyright (c) 2018-2019 Jeroen De Meerleer <schaak@jeroened.be>
|
2019-02-11 16:43:36 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace JeroenED\Libpairtwo;
|
|
|
|
|
2019-06-19 19:49:39 +02:00
|
|
|
use JeroenED\Libpairtwo\Enums\Color;
|
|
|
|
use JeroenED\Libpairtwo\Enums\Result;
|
2019-02-11 16:43:36 +01:00
|
|
|
|
2019-06-19 19:49:39 +02:00
|
|
|
/**
|
|
|
|
* Class Pairing
|
|
|
|
*
|
|
|
|
* Class for a pairing of the tournament
|
|
|
|
*
|
|
|
|
* @author Jeroen De Meerleer <schaak@jeroened.be>
|
|
|
|
* @category Main
|
|
|
|
* @package Libpairtwo
|
|
|
|
* @copyright Copyright (c) 2018-2019 Jeroen De Meerleer <schaak@jeroened.be>
|
|
|
|
*/
|
|
|
|
class Pairing
|
2019-02-11 16:43:36 +01:00
|
|
|
{
|
2019-06-20 14:53:26 +02:00
|
|
|
/** @var Player | null */
|
2019-06-19 19:49:39 +02:00
|
|
|
private $Player;
|
|
|
|
|
2019-06-20 14:53:26 +02:00
|
|
|
/** @var Player | null */
|
2019-06-19 19:49:39 +02:00
|
|
|
private $Opponent;
|
|
|
|
|
|
|
|
/** @var Color */
|
|
|
|
private $Color;
|
|
|
|
|
|
|
|
/** @var Result */
|
|
|
|
private $Result;
|
|
|
|
|
|
|
|
/** @var int */
|
|
|
|
private $Round;
|
|
|
|
|
2019-09-28 20:17:38 +02:00
|
|
|
/** @var int */
|
|
|
|
private $Board;
|
|
|
|
|
2019-06-19 19:49:39 +02:00
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Returns the player of the pairing
|
|
|
|
*
|
|
|
|
* @return Player | null
|
2019-06-19 19:49:39 +02:00
|
|
|
*/
|
|
|
|
public function getPlayer(): ?Player
|
|
|
|
{
|
|
|
|
return $this->Player;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Sets the player of the pairing
|
|
|
|
*
|
|
|
|
* @param Player | null $Player
|
2019-06-19 19:49:39 +02:00
|
|
|
* @return Pairing
|
|
|
|
*/
|
|
|
|
public function setPlayer(?Player $Player): Pairing
|
|
|
|
{
|
|
|
|
$this->Player = $Player;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Returns the opponent of the pairing
|
|
|
|
*
|
|
|
|
* @return Player | null
|
2019-06-19 19:49:39 +02:00
|
|
|
*/
|
|
|
|
public function getOpponent(): ?Player
|
|
|
|
{
|
|
|
|
return $this->Opponent;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Sets the opponent of the pairing
|
|
|
|
*
|
|
|
|
* @param Player | null $Opponent
|
2019-06-19 19:49:39 +02:00
|
|
|
* @return Pairing
|
|
|
|
*/
|
|
|
|
public function setOpponent(?Player $Opponent): Pairing
|
|
|
|
{
|
|
|
|
$this->Opponent = $Opponent;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Returns the color of the pairing
|
|
|
|
*
|
2019-06-19 19:49:39 +02:00
|
|
|
* @return Color
|
|
|
|
*/
|
|
|
|
public function getColor(): Color
|
|
|
|
{
|
|
|
|
return $this->Color;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Sets the color of the pairing
|
|
|
|
*
|
2019-06-19 19:49:39 +02:00
|
|
|
* @param Color $Color
|
|
|
|
* @return Pairing
|
|
|
|
*/
|
|
|
|
public function setColor(Color $Color): Pairing
|
|
|
|
{
|
|
|
|
$this->Color = $Color;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Returns the individual result of the pairing
|
|
|
|
*
|
2019-06-19 19:49:39 +02:00
|
|
|
* @return Result
|
|
|
|
*/
|
|
|
|
public function getResult(): Result
|
|
|
|
{
|
|
|
|
return $this->Result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Sets the individual result of the pairing
|
|
|
|
*
|
2019-06-19 19:49:39 +02:00
|
|
|
* @param Result $Result
|
|
|
|
* @return Pairing
|
|
|
|
*/
|
|
|
|
public function setResult(Result $Result): Pairing
|
|
|
|
{
|
|
|
|
$this->Result = $Result;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Returns the round number of the pairing
|
|
|
|
*
|
2019-06-19 19:49:39 +02:00
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getRound(): int
|
|
|
|
{
|
|
|
|
return $this->Round;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-20 14:53:26 +02:00
|
|
|
* Sets the round number of the pairing
|
|
|
|
*
|
2019-06-19 19:49:39 +02:00
|
|
|
* @param int $Round
|
|
|
|
* @return Pairing
|
|
|
|
*/
|
|
|
|
public function setRound(int $Round): Pairing
|
|
|
|
{
|
|
|
|
$this->Round = $Round;
|
|
|
|
return $this;
|
|
|
|
}
|
2019-09-28 20:17:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the board no of the pairing
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getBoard(): int
|
|
|
|
{
|
|
|
|
return $this->Board;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the board no of the pairing
|
|
|
|
*
|
|
|
|
* @param int $Board
|
|
|
|
*/
|
|
|
|
public function setBoard(int $Board): void
|
|
|
|
{
|
|
|
|
$this->Board = $Board;
|
|
|
|
}
|
2019-02-11 17:37:30 +01:00
|
|
|
}
|