From b6eaf573fe0ebaf462ce46fc04ea24b4c0774480 Mon Sep 17 00:00:00 2001 From: Fibinger Ádám <adam.fibinger@wup.hu> Date: Mon, 06 Apr 2020 18:08:56 +0200 Subject: [PATCH] Új operátorok --- EOG/Models/Stripe.php | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/EOG/Models/Stripe.php b/EOG/Models/Stripe.php index f5734fb..15170d5 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']; + 'valkyrie', 'vigil', 'warden', 'ying', 'zofia', 'wamai', 'kali', 'iana', 'oryx']; protected $state = [ 'stripe' => [ 'class' => 'team', @@ -31,13 +31,22 @@ 'ban' => [ 'mira', 'jackal' + ], + 'score' => [ + true, + true ] + ], 'blue' => [ 'name' => 'Kék csapat', 'ban' => [ 'rook', 'blitz' + ], + 'score' => [ + true, + true ] ] ] @@ -58,6 +67,11 @@ private function setSimpleStripe() { unset($this->state['team']); + } + + public function setScore(string $team, int $number, bool $score) + { + $this->state['team'][$team]['score'][$number] = $score; } public function setCup(string $number, string $name) @@ -125,10 +139,25 @@ public function loadFromArray(array $state) { - unset($this->state); $this->state = []; + 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']['blue']['score'][0])) { + $this->setScore('blue',0,true); + } + + if (!empty($state['team']['blue']['score'][1])) { + $this->setScore('blue',1,true); + } + if (!empty($state['stripe']["class"])) { $this->setClass($state['stripe']["class"]); -- Gitblit v1.8.0