Merge branch 'bugfix/noresult' into develop

This commit is contained in:
Jeroen De Meerleer 2019-05-28 10:16:51 +02:00
commit 89a58a00de
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 7 additions and 0 deletions

View File

@ -12,6 +12,7 @@ use MyCLabs\Enum\Enum;
class Gameresult extends Enum
{
const None = '-';
const WhiteWins = '1-0';
const Draw = '0.5-0.5';
const BlackWins = '0-1';

View File

@ -35,6 +35,12 @@ class Game extends GameModel
if (isset($blacksplit[1]) && $blacksplit[1] != 'Bye') {
$special = ' ' . $blacksplit[1];
}
if ($whitesplit[0] == '*') {
$whitesplit[0] = '';
}
if ($blacksplit[0] == '*') {
$blacksplit[0] = '';
}
$result = new Gameresult($whitesplit[0] . '-' . $blacksplit[0] . $special);
$this->setResult($result);