From ffa7c6f5c007dfc826aef0ca27d23bb69bbeed7e Mon Sep 17 00:00:00 2001 From: Fibinger Ádám <adam.fibinger@wup.hu> Date: Thu, 04 Jun 2020 23:10:08 +0200 Subject: [PATCH] BO pöttyök + BestOf kupa típus --- EOG/Models/Stripe.php | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 36 insertions(+), 17 deletions(-) diff --git a/EOG/Models/Stripe.php b/EOG/Models/Stripe.php index 15170d5..3250137 100644 --- a/EOG/Models/Stripe.php +++ b/EOG/Models/Stripe.php @@ -15,7 +15,7 @@ 'glaz', 'goyo', 'gridlock', 'hibana', 'iq', 'jackal', 'jager', 'kaid', 'kapkan', 'lesion', 'lion', 'maestro', 'maverick', 'mira', 'montagne', 'mozzie', 'mute', 'nokk', 'nomad', 'pulse', 'rook', 'sledge', 'smoke', 'tachanka', 'thatcher', 'thermite', 'twitch', - 'valkyrie', 'vigil', 'warden', 'ying', 'zofia', 'wamai', 'kali', 'iana', 'oryx']; + 'valkyrie', 'vigil', 'warden', 'ying', 'zofia', 'wamai', 'kali', 'iana', 'oryx', 'no-ban', 'no-ban2']; protected $state = [ 'stripe' => [ 'class' => 'team', @@ -23,28 +23,31 @@ 'cup' => [ 'number' => '#76', 'name' => '5on5 Open Cup', + 'bestof' => '5', ], 'team' => [ 'orange' => [ - 'name' => 'Narancs Csapat', - 'ban' => [ + 'name' => 'Narancs Csapat', + 'ban' => [ 'mira', 'jackal' ], 'score' => [ + true, true, true ] ], 'blue' => [ - 'name' => 'Kék csapat', - 'ban' => [ + 'name' => 'Kék csapat', + 'ban' => [ 'rook', 'blitz' ], 'score' => [ + true, true, true ] @@ -74,10 +77,11 @@ $this->state['team'][$team]['score'][$number] = $score; } - public function setCup(string $number, string $name) + public function setCup(string $number, string $name, int $bestOf = 1) { $this->state['cup']['number'] = $number; $this->state['cup']['name'] = $name; + $this->state['cup']['bestof'] = $bestOf; } /** @@ -93,7 +97,7 @@ } } - public function setTeamName(string $team_color = self::TEAM_BLUE, $name= '') + public function setTeamName(string $team_color = self::TEAM_BLUE, $name = '') { $this->testColor($team_color); $this->state['team'][$team_color]['name'] = $name; @@ -142,20 +146,34 @@ unset($this->state); $this->state = []; - if (!empty($state['team']['orange']['score'][0])) { - $this->setScore('orange',0,true); + if (!empty($state['team']['orange']['score'][0])) + { + $this->setScore('orange', 0, true); } - if (!empty($state['team']['orange']['score'][1])) { - $this->setScore('orange',1,true); + if (!empty($state['team']['orange']['score'][1])) + { + $this->setScore('orange', 1, true); } - if (!empty($state['team']['blue']['score'][0])) { - $this->setScore('blue',0,true); + if (!empty($state['team']['orange']['score'][2])) + { + $this->setScore('orange', 2, true); } - if (!empty($state['team']['blue']['score'][1])) { - $this->setScore('blue',1,true); + if (!empty($state['team']['blue']['score'][0])) + { + $this->setScore('blue', 0, true); + } + + if (!empty($state['team']['blue']['score'][1])) + { + $this->setScore('blue', 1, true); + } + + if (!empty($state['team']['blue']['score'][2])) + { + $this->setScore('blue', 2, true); } if (!empty($state['stripe']["class"])) @@ -163,11 +181,12 @@ $this->setClass($state['stripe']["class"]); } - if (!empty($state['cup']['name']) || !empty($state['cup']['number'])) + if (!empty($state['cup']['name']) || !empty($state['cup']['number']) || !empty($state['cup']['bestof'])) { $cupNum = $state['cup']['number'] ?? ''; $cupName = $state['cup']['name'] ?? ''; - $this->setCup($cupNum, $cupName); + $bestOf = (int) $state['cup']['bestof'] ?? 1; + $this->setCup($cupNum, $cupName, $bestOf); } if (!empty($state['team'])) -- Gitblit v1.8.0