2019-02-06 17:23:37 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Created by PhpStorm.
|
|
|
|
* User: jeroen
|
|
|
|
* Date: 1/02/19
|
|
|
|
* Time: 17:16
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace JeroenED\Libpairtwo\Models;
|
|
|
|
|
2019-02-11 22:41:44 +01:00
|
|
|
use JeroenED\Libpairtwo\Enums\Gameresult;
|
2019-03-20 17:33:09 +01:00
|
|
|
use JeroenED\Libpairtwo\Pairing;
|
2019-02-11 22:41:44 +01:00
|
|
|
|
2019-05-27 13:15:28 +02:00
|
|
|
abstract class Game
|
2019-02-06 17:23:37 +01:00
|
|
|
{
|
2019-06-01 16:39:58 +02:00
|
|
|
/** @var Pairing|null */
|
2019-02-11 22:41:44 +01:00
|
|
|
private $white;
|
|
|
|
|
2019-06-01 16:39:58 +02:00
|
|
|
/** @var Pairing|null */
|
2019-02-11 22:41:44 +01:00
|
|
|
private $black;
|
|
|
|
|
2019-06-01 16:39:58 +02:00
|
|
|
/** @var GameResult|null */
|
2019-02-11 22:41:44 +01:00
|
|
|
private $result;
|
|
|
|
|
|
|
|
/**
|
2019-06-01 16:39:58 +02:00
|
|
|
* @return Pairing|null
|
2019-02-11 22:41:44 +01:00
|
|
|
*/
|
2019-06-01 16:39:58 +02:00
|
|
|
public function getWhite(): ?Pairing
|
2019-02-11 22:41:44 +01:00
|
|
|
{
|
|
|
|
return $this->white;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-01 16:39:58 +02:00
|
|
|
* @param Pairing|null $white
|
|
|
|
* @return Game
|
2019-02-11 22:41:44 +01:00
|
|
|
*/
|
2019-06-01 16:39:58 +02:00
|
|
|
public function setWhite(?Pairing $white): Game
|
2019-02-11 22:41:44 +01:00
|
|
|
{
|
|
|
|
$this->white = $white;
|
2019-06-01 16:39:58 +02:00
|
|
|
return $this;
|
2019-02-11 22:41:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-01 16:39:58 +02:00
|
|
|
* @return Pairing|null
|
2019-02-11 22:41:44 +01:00
|
|
|
*/
|
2019-06-01 16:39:58 +02:00
|
|
|
public function getBlack(): ?Pairing
|
2019-02-11 22:41:44 +01:00
|
|
|
{
|
|
|
|
return $this->black;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-01 16:39:58 +02:00
|
|
|
* @param Pairing|null $black
|
|
|
|
* @return Game
|
2019-02-11 22:41:44 +01:00
|
|
|
*/
|
2019-06-01 16:39:58 +02:00
|
|
|
public function setBlack(?Pairing $black): Game
|
2019-02-11 22:41:44 +01:00
|
|
|
{
|
|
|
|
$this->black = $black;
|
2019-06-01 16:39:58 +02:00
|
|
|
return $this;
|
2019-02-11 22:41:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-01 16:39:58 +02:00
|
|
|
* @return Gameresult|null
|
2019-02-11 22:41:44 +01:00
|
|
|
*/
|
2019-06-01 16:39:58 +02:00
|
|
|
public function getResult(): ?Gameresult
|
2019-02-11 22:41:44 +01:00
|
|
|
{
|
|
|
|
return $this->result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-01 16:39:58 +02:00
|
|
|
* @param Gameresult|null $result
|
|
|
|
* @return Game
|
2019-02-11 22:41:44 +01:00
|
|
|
*/
|
2019-06-01 16:39:58 +02:00
|
|
|
public function setResult(?Gameresult $result): Game
|
2019-02-11 22:41:44 +01:00
|
|
|
{
|
|
|
|
$this->result = $result;
|
2019-06-01 16:39:58 +02:00
|
|
|
return $this;
|
2019-02-11 22:41:44 +01:00
|
|
|
}
|
2019-02-11 17:37:30 +01:00
|
|
|
}
|