Added tournament year and rounddates

This commit is contained in:
Jeroen De Meerleer 2019-02-11 16:42:20 +01:00
parent 1747373b58
commit 95801e8b4e
2 changed files with 29 additions and 1 deletions

View File

@ -54,6 +54,7 @@ class Tournament
private $SecondPeriod;
private $Federation;
private $Players;
private $Year;
/**
* @return string
@ -359,4 +360,20 @@ class Tournament
$this->Players = $Players;
}
/**
* @return mixed
*/
public function getYear()
{
return $this->Year;
}
/**
* @param mixed $Year
*/
public function setYear($Year): void
{
$this->Year = $Year;
}
}

View File

@ -457,7 +457,18 @@ class Sws extends SwsModel
$sws->getTournament()->setOrganiserClub(self::ReadData('String', substr($swscontents, $offset, $length)));
$offset += $length;
// echo dechex($offset) . PHP_EOL;
// Tournament year
$length = 4;
$sws->getTournament()->setYear(self::ReadData('Int', substr($swscontents, $offset, $length)));
$offset += $length;
// Round dates
for ($i = 1; $i < $sws->getTournament()->getRounds(); $i++) {
$length = 4;
$sws->setBinaryData('Round_' . $i . '_date', self::ReadData('Date', substr($swscontents, $offset, $length)));
$offset += $length;
}
if ($sws->getBinaryData("CurrentRound") > 0) {
// echo "go" . PHP_EOL;
for ($i = 0; $i < $sws->getBinaryData("CreatedRounds"); $i++) {