Fibinger Ádám
2020-06-04 ffa7c6f5c007dfc826aef0ca27d23bb69bbeed7e
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', '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']))