| | |
| | | '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']; |
| | | 'valkyrie', 'vigil', 'warden', 'ying', 'zofia', 'wamai', 'kali', 'iana', 'oryx', 'no-ban', 'no-ban2']; |
| | | protected $state = [ |
| | | 'stripe' => [ |
| | | 'class' => 'team', |
| | |
| | | 'ban' => [ |
| | | 'mira', |
| | | 'jackal' |
| | | ], |
| | | 'score' => [ |
| | | true, |
| | | true |
| | | ] |
| | | |
| | | ], |
| | | 'blue' => [ |
| | | 'name' => 'Kék csapat', |
| | | 'ban' => [ |
| | | 'rook', |
| | | 'blitz' |
| | | ], |
| | | 'score' => [ |
| | | true, |
| | | true |
| | | ] |
| | | ] |
| | | ] |
| | |
| | | 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) |
| | | { |
| | | $this->state['cup']['number'] = $number; |
| | |
| | | { |
| | | if (!in_array($color, $this->allowedColors)) |
| | | { |
| | | throw new \InvalidArgumentException("Given colour " . $team_color . " not allowed. Allowed colours: " . implode(', ', $this->allowedColors)); |
| | | throw new \InvalidArgumentException("Given colour " . $color . " not allowed. Allowed colours: " . implode(', ', $this->allowedColors)); |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | | public function addTeamBan(string $team_color = self::TEAM_BLUE, $operator) |
| | | public function addTeamBan(string $team_color = self::TEAM_BLUE, $operator = '') |
| | | { |
| | | $this->testColor($team_color); |
| | | if (!in_array($operator, $this->allowedOperators)) |
| | |
| | | |
| | | 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"]); |