From 58851af343b13369eea129c4a8731cf3af3748ee Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Thu, 19 Sep 2024 12:06:35 +0200 Subject: [PATCH] Added presence points handling in Swar6 reader The update introduces a new feature to handle presence points in the Swar6 reader. If the tournament uses presence points, it now assigns these to 'absence' and removes them from 'presence'. The change also removes an unnecessary line related to EloUsed. --- src/Readers/Swar6.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Readers/Swar6.php b/src/Readers/Swar6.php index a8655e2..5688bc3 100644 --- a/src/Readers/Swar6.php +++ b/src/Readers/Swar6.php @@ -283,8 +283,12 @@ class Swar6 implements ReaderInterface $custompoints['loss'] = $this->readData('Int', $swshandle) / 4; $custompoints['bye'] = $this->readData('Int', $swshandle) / 4; $custompoints['presence'] = $this->readData('Int', $swshandle) / 4; + $this->Tournament->IsPresencePoints = (bool)$this->readData('Int', $swshandle); + if(!$this->Tournament->IsPresencePoints) { + $custompoints['absence'] = $custompoints['presence']; + unset($custompoints['presence']) + } if($applycustompoints) $this->Tournament->CustomPoints = $custompoints; - $this->Tournament->EloUsed = $this->readData('Int', $swshandle); $this->Tournament->TournoiStd = $this->readData('Int', $swshandle); $this->Tournament->TbPersonel = $this->readData('Int', $swshandle); $this->Tournament->ApparOrder = $this->readData('Int', $swshandle);