mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-12-25 13:50:59 +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
|
||||
{
|
||||
const Swiss = 0;
|
||||
const Closed = 2;
|
||||
const American = 4;
|
||||
const Imperial = 6;
|
||||
const Swiss = 'Swiss';
|
||||
const Closed = 'Closed';
|
||||
const American = 'American';
|
||||
const Imperial = 'Imperal';
|
||||
}
|
||||
|
15
src/Sws.php
15
src/Sws.php
@ -483,7 +483,20 @@ class Sws extends SwsModel
|
||||
|
||||
// Type
|
||||
$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;
|
||||
|
||||
// Federation
|
||||
|
Loading…
Reference in New Issue
Block a user