1
|
|
|
<?php |
2
|
|
|
namespace Perry\Representation\Eve\v1; |
3
|
|
|
|
4
|
|
|
use \Perry\Representation\Reference as Reference; |
5
|
|
|
use \Perry\Representation\Uri as Uri; |
6
|
|
|
use \Perry\Representation\Base as Base; |
7
|
|
|
|
8
|
|
|
class TournamentSeries extends Base |
9
|
|
|
{ |
10
|
|
|
public $matchesInProgress = []; |
11
|
|
|
|
12
|
|
|
public $redTeam; |
13
|
|
|
|
14
|
|
|
public $matchesWon; |
15
|
|
|
|
16
|
|
|
public $matches; |
17
|
|
|
|
18
|
|
|
public $self; |
19
|
|
|
|
20
|
|
|
public $winner; |
21
|
|
|
|
22
|
|
|
public $loser; |
23
|
|
|
|
24
|
|
|
public $length; |
25
|
|
|
|
26
|
|
|
public $blueTeam; |
27
|
|
|
|
28
|
|
|
public $structure; |
29
|
|
|
|
30
|
|
|
// by Warringer\Types\ArrayType |
31
|
|
|
public function setMatchesInProgress($matchesInProgress) |
32
|
|
|
{ |
33
|
|
|
// by Warringer\Types\Reference |
34
|
|
|
$func = function ($value) { return new Reference($value); }; |
35
|
|
|
|
36
|
|
|
foreach ($matchesInProgress as $key => $value) { |
37
|
|
|
$this->matchesInProgress[$key] = $func($value); |
38
|
|
|
} |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
// by Warringer\Types\Dict |
42
|
|
|
public function setRedTeam($redTeam) |
43
|
|
|
{ |
44
|
|
|
// by Warringer\Types\Dict |
45
|
|
|
$converters = []; |
46
|
|
|
$converters['team'] = function ($value) { return new Reference($value); }; |
47
|
|
|
$converters['isDecided'] = function ($value) { return $value; }; |
48
|
|
|
$converters['isBye'] = function ($value) { return $value; }; |
49
|
|
|
|
50
|
|
|
$func = function ($value) use($converters) { |
51
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
52
|
|
|
$return['team'] = isset($value->{'team'}) ? $converters['team']($value->{'team'}) : null; |
53
|
|
|
$return['isDecided'] = isset($value->{'isDecided'}) ? $converters['isDecided']($value->{'isDecided'}) : null; |
54
|
|
|
$return['isBye'] = isset($value->{'isBye'}) ? $converters['isBye']($value->{'isBye'}) : null; |
55
|
|
|
return $return; |
56
|
|
|
}; |
57
|
|
|
$this->redTeam = $func($redTeam); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
// by Warringer\Types\Dict |
61
|
|
|
public function setMatchesWon($matchesWon) |
62
|
|
|
{ |
63
|
|
|
// by Warringer\Types\Dict |
64
|
|
|
$converters = []; |
65
|
|
|
$converters['redTeam'] = function ($value) { return $value; }; |
66
|
|
|
$converters['blueTeam'] = function ($value) { return $value; }; |
67
|
|
|
|
68
|
|
|
$func = function ($value) use($converters) { |
69
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
70
|
|
|
$return['redTeam'] = isset($value->{'redTeam'}) ? $converters['redTeam']($value->{'redTeam'}) : null; |
71
|
|
|
$return['blueTeam'] = isset($value->{'blueTeam'}) ? $converters['blueTeam']($value->{'blueTeam'}) : null; |
72
|
|
|
return $return; |
73
|
|
|
}; |
74
|
|
|
$this->matchesWon = $func($matchesWon); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
// by Warringer\Types\Reference |
78
|
|
|
public function setMatches($matches) |
79
|
|
|
{ |
80
|
|
|
$this->matches = new Reference($matches); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
// by Warringer\Types\Reference |
84
|
|
|
public function setSelf($self) |
85
|
|
|
{ |
86
|
|
|
$this->self = new Reference($self); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
// by Warringer\Types\Dict |
90
|
|
|
public function setWinner($winner) |
91
|
|
|
{ |
92
|
|
|
// by Warringer\Types\Dict |
93
|
|
|
$converters = []; |
94
|
|
|
$converters['team'] = function ($value) { return new Reference($value); }; |
95
|
|
|
$converters['isDecided'] = function ($value) { return $value; }; |
96
|
|
|
$converters['isBye'] = function ($value) { return $value; }; |
97
|
|
|
|
98
|
|
|
$func = function ($value) use($converters) { |
99
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
100
|
|
|
$return['team'] = isset($value->{'team'}) ? $converters['team']($value->{'team'}) : null; |
101
|
|
|
$return['isDecided'] = isset($value->{'isDecided'}) ? $converters['isDecided']($value->{'isDecided'}) : null; |
102
|
|
|
$return['isBye'] = isset($value->{'isBye'}) ? $converters['isBye']($value->{'isBye'}) : null; |
103
|
|
|
return $return; |
104
|
|
|
}; |
105
|
|
|
$this->winner = $func($winner); |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
// by Warringer\Types\Dict |
109
|
|
|
public function setLoser($loser) |
110
|
|
|
{ |
111
|
|
|
// by Warringer\Types\Dict |
112
|
|
|
$converters = []; |
113
|
|
|
$converters['team'] = function ($value) { return new Reference($value); }; |
114
|
|
|
$converters['isDecided'] = function ($value) { return $value; }; |
115
|
|
|
$converters['isBye'] = function ($value) { return $value; }; |
116
|
|
|
|
117
|
|
|
$func = function ($value) use($converters) { |
118
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
119
|
|
|
$return['team'] = isset($value->{'team'}) ? $converters['team']($value->{'team'}) : null; |
120
|
|
|
$return['isDecided'] = isset($value->{'isDecided'}) ? $converters['isDecided']($value->{'isDecided'}) : null; |
121
|
|
|
$return['isBye'] = isset($value->{'isBye'}) ? $converters['isBye']($value->{'isBye'}) : null; |
122
|
|
|
return $return; |
123
|
|
|
}; |
124
|
|
|
$this->loser = $func($loser); |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
// by Warringer\Types\Long |
128
|
|
|
public function setLength($length) |
129
|
|
|
{ |
130
|
|
|
$this->length = $length; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
// by Warringer\Types\Dict |
134
|
|
|
public function setBlueTeam($blueTeam) |
135
|
|
|
{ |
136
|
|
|
// by Warringer\Types\Dict |
137
|
|
|
$converters = []; |
138
|
|
|
$converters['team'] = function ($value) { return new Reference($value); }; |
139
|
|
|
$converters['isDecided'] = function ($value) { return $value; }; |
140
|
|
|
$converters['isBye'] = function ($value) { return $value; }; |
141
|
|
|
|
142
|
|
|
$func = function ($value) use($converters) { |
143
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
144
|
|
|
$return['team'] = isset($value->{'team'}) ? $converters['team']($value->{'team'}) : null; |
145
|
|
|
$return['isDecided'] = isset($value->{'isDecided'}) ? $converters['isDecided']($value->{'isDecided'}) : null; |
146
|
|
|
$return['isBye'] = isset($value->{'isBye'}) ? $converters['isBye']($value->{'isBye'}) : null; |
147
|
|
|
return $return; |
148
|
|
|
}; |
149
|
|
|
$this->blueTeam = $func($blueTeam); |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
// by Warringer\Types\Dict |
153
|
|
|
public function setStructure($structure) |
154
|
|
|
{ |
155
|
|
|
// by Warringer\Types\Dict |
156
|
|
|
$converters = []; |
157
|
|
|
$converters['outgoingLoser'] = function ($value) { return new Reference($value); }; |
158
|
|
|
$converters['outgoingWinner'] = function ($value) { return new Reference($value); }; |
159
|
|
|
$converters['incomingRed'] = function ($value) { return new Reference($value); }; |
160
|
|
|
$converters['incomingBlue'] = function ($value) { return new Reference($value); }; |
161
|
|
|
|
162
|
|
|
$func = function ($value) use($converters) { |
163
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
164
|
|
|
$return['outgoingLoser'] = isset($value->{'outgoingLoser'}) ? $converters['outgoingLoser']($value->{'outgoingLoser'}) : null; |
165
|
|
|
$return['outgoingWinner'] = isset($value->{'outgoingWinner'}) ? $converters['outgoingWinner']($value->{'outgoingWinner'}) : null; |
166
|
|
|
$return['incomingRed'] = isset($value->{'incomingRed'}) ? $converters['incomingRed']($value->{'incomingRed'}) : null; |
167
|
|
|
$return['incomingBlue'] = isset($value->{'incomingBlue'}) ? $converters['incomingBlue']($value->{'incomingBlue'}) : null; |
168
|
|
|
return $return; |
169
|
|
|
}; |
170
|
|
|
$this->structure = $func($structure); |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
} |
174
|
|
|
|