<?php

namespace App\Presenters;

use Nette;
use App\Model;


/**
 * Base presenter for all application presenters.
 */
abstract class BasePresenter extends Nette\Application\UI\Presenter
{

	/**
	 * @inject
	 * @var \App\Model\GameManager
	 */
	public $GameM;
	
	public function beforeRender()
	{
		$this->template->start_time = '';

		$avgpeople = $this->GameM->GetAvgPeople();

        $this->template->avgpeople = $avgpeople;
		$this->getMenu();
		
	}
	
	function getMenu()
	{
		$menu = array(  
				"Webs:" => "Instructions",
            "Webs:era" => "Era",
            "Webs:town" => "Town",
				"Webs:plague" => "Plague",
				"Webs:vocab" => "Vocabulary",
				"Homepage:default" => "Play!");
		
		$playArray = array( "FirstPresenter", "SecondPresenter", "ThirdPresenter", "HomepagePresenter" );
		
		$action = ($this->getAction() == "default") ? "" : $this->getAction();
		
		$presenterName = get_class($this);
		$this->template->presenterName = $presenterName;
		
		$this->template->playArray = $playArray;
		$this->template->action = $action;
		$this->template->menu = $menu;
		
		
	}
	
}
