mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-21 22:17:41 +01:00
Get rid of Pairtwo Values in favor of generic ones
This commit is contained in:
parent
7fb94aaf00
commit
bad50fc75c
@ -12,15 +12,15 @@ use MyCLabs\Enum\Enum;
|
||||
|
||||
class Result extends Enum
|
||||
{
|
||||
const none = 0;
|
||||
const lost = 1;
|
||||
const draw = 6;
|
||||
const won = 11;
|
||||
const absent = 2;
|
||||
const wonforfait = 12;
|
||||
const adjourn = 3;
|
||||
const drawadjourned = 8;
|
||||
const wonadjourned = 13;
|
||||
const bye = 4;
|
||||
const wonbye = 14;
|
||||
const none = '*';
|
||||
const lost = '0';
|
||||
const draw = '0.5';
|
||||
const won = '1';
|
||||
const absent = '0 FF';
|
||||
const wonforfait = '1 FF';
|
||||
const adjourn = '0 A';
|
||||
const drawadjourned = '0.5 A';
|
||||
const wonadjourned = '1 A';
|
||||
const bye = '0 Bye';
|
||||
const wonbye = '1 Bye';
|
||||
}
|
||||
|
38
src/Sws.php
38
src/Sws.php
@ -509,7 +509,43 @@ class Sws extends SwsModel
|
||||
$offset += $length;
|
||||
|
||||
$length = 1;
|
||||
$pairing->setResult(new Result(self::ReadData('Int', substr($swscontents, $offset, $length))));
|
||||
Switch(self::ReadData('Int', substr($swscontents, $offset, $length)))
|
||||
{
|
||||
case 0:
|
||||
$result = '*';
|
||||
break;
|
||||
case 1:
|
||||
$result = '0';
|
||||
break;
|
||||
case 2:
|
||||
$result = '0 FF';
|
||||
break;
|
||||
case 3:
|
||||
$result = '0 A';
|
||||
break;
|
||||
case 4:
|
||||
$result = '0 Bye';
|
||||
break;
|
||||
case 6:
|
||||
$result = '0.5';
|
||||
break;
|
||||
case 8:
|
||||
$result = '0.5 A';
|
||||
break;
|
||||
case 11:
|
||||
$result = '1';
|
||||
break;
|
||||
case 12:
|
||||
$result = '1 FF';
|
||||
break;
|
||||
case 13:
|
||||
$result = '1 A';
|
||||
break;
|
||||
case 13:
|
||||
$result = '1 Bye';
|
||||
break;
|
||||
}
|
||||
$pairing->setResult(new Result($result));
|
||||
$offset += $length;
|
||||
|
||||
$pairing->setRound($x);
|
||||
|
Loading…
Reference in New Issue
Block a user