Fibinger Ádám
2020-03-27 b158104ad7bc0ef74466e26620f66949ba6f730f
EOG/Models/Stripe.php
@@ -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"]);