| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function generate($rows, $columns, $seed = null) |
||
| 16 | { |
||
| 17 | $this->validatePositiveInteger($rows); |
||
| 18 | $this->validatePositiveInteger($columns); |
||
| 19 | $this->validateOptionalInteger($seed); |
||
| 20 | |||
| 21 | mt_srand($seed); |
||
| 22 | |||
| 23 | $terrainCost = array(); |
||
| 24 | |||
| 25 | foreach (range(0, $rows - 1) as $row) { |
||
| 26 | foreach (range(0, $columns - 1) as $column) { |
||
| 27 | $terrainCost[$row][$column] = mt_rand(1, 10); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | return new TerrainCost($terrainCost); |
||
| 32 | } |
||
| 33 | |||
| 52 |