mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-12-01 18:51:32 +01:00
Replaced pairtwo Tournament System Values for generic Values
This commit is contained in:
parent
34f0e592df
commit
32a0021ff2
@ -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