mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-18 20:04:28 +00:00
Cleanup in src/, adding namespaces, removing php closing tag and general code cleanup
This commit is contained in:
25
src/FactorGraphs/ScheduleSequence.php
Normal file
25
src/FactorGraphs/ScheduleSequence.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php namespace Moserware\Skills\FactorGraphs;
|
||||
|
||||
class ScheduleSequence extends Schedule
|
||||
{
|
||||
private $_schedules;
|
||||
|
||||
public function __construct($name, array $schedules)
|
||||
{
|
||||
parent::__construct($name);
|
||||
$this->_schedules = $schedules;
|
||||
}
|
||||
|
||||
public function visit($depth = -1, $maxDepth = 0)
|
||||
{
|
||||
$maxDelta = 0;
|
||||
|
||||
$schedules = &$this->_schedules;
|
||||
foreach ($schedules as &$currentSchedule) {
|
||||
$currentVisit = $currentSchedule->visit($depth + 1, $maxDepth);
|
||||
$maxDelta = max($currentVisit, $maxDelta);
|
||||
}
|
||||
|
||||
return $maxDelta;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user