<?php
class ChairmanCore {
    private $container;

    public function __construct(ChairmanContainer $container) {
        $this->container = $container;
    }

    public function service($name) {
        return $this->container->get($name);
    }

    public function health() {
        return $this->service('health')->health();
    }

    public function requiredTablesStatus() {
        return $this->service('health')->requiredTablesStatus();
    }

    public function getRaceRanking($raceDate, $venue='', $raceNum=0) {
        return $this->service('race')->getRaceRanking($raceDate,$venue,$raceNum);
    }

    public function getRaceSummary($raceDate, $venue='', $raceNum=0) {
        return $this->service('race')->getRaceSummary($raceDate,$venue,$raceNum);
    }

    public function getAnalysisPayload($raceDate, $venue='', $raceNum=0) {
        return $this->service('race')->getAnalysisPayload($raceDate,$venue,$raceNum);
    }

    public function buildCache($raceDate, $venue='', $raceNum=0) {
        return $this->service('cache')->buildCache($raceDate,$venue,$raceNum);
    }

    public function readCache($raceDate, $venue='', $raceNum=0) {
        return $this->service('cache')->readCache($raceDate,$venue,$raceNum);
    }

    public function getProductionPayload($raceDate, $venue='', $raceNum=0) { return $this->service('race')->getProductionPayload($raceDate,$venue,$raceNum); }

    public function runProductionEngine($raceDate, $venue='', $raceNum=0) { return $this->service('productionEngine')->run($raceDate,$venue,$raceNum); }

    public function analysisBridgeSample($raceDate, $venue='', $raceNum=0) {
        return $this->service('bridge')->sample($raceDate,$venue,$raceNum);
    }
}
