mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-24 15:31:00 +01:00
Replaced pairtwo Tournament System Values for generic Values
This commit is contained in:
parent
e0da8a71cd
commit
a2a0f99b14
@ -12,8 +12,8 @@ use MyCLabs\Enum\Enum;
|
|||||||
|
|
||||||
class TournamentSystem extends Enum
|
class TournamentSystem extends Enum
|
||||||
{
|
{
|
||||||
const Swiss = 0;
|
const Swiss = 'Swiss';
|
||||||
const Closed = 2;
|
const Closed = 'Closed';
|
||||||
const American = 4;
|
const American = 'American';
|
||||||
const Imperial = 6;
|
const Imperial = 'Imperal';
|
||||||
}
|
}
|
||||||
|
15
src/Sws.php
15
src/Sws.php
@ -483,7 +483,20 @@ class Sws extends SwsModel
|
|||||||
|
|
||||||
// Type
|
// Type
|
||||||
$length = 4;
|
$length = 4;
|
||||||
$sws->getTournament()->setSystem(new TournamentSystem(self::ReadData('Int', substr($swscontents, $offset, $length))));
|
Switch(self::ReadData('Int', substr($swscontents, $offset, $length))) {
|
||||||
|
case 0:
|
||||||
|
$system = TournamentSystem::Swiss;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$system = TournamentSystem::Closed;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$system = TournamentSystem::American;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$system = TournamentSystem::Imperial;
|
||||||
|
}
|
||||||
|
$sws->getTournament()->setSystem(new TournamentSystem($system));
|
||||||
$offset += $length;
|
$offset += $length;
|
||||||
|
|
||||||
// Federation
|
// Federation
|
||||||
|
Loading…
Reference in New Issue
Block a user