<?php
/*С крипа берет начало каждый класс. Надо ли делать его абстрактным 
если там нет ни одного абстрактного метода?*/
abstract class Creep
{
	//Базовые данные. потом стоит изменить к ним доступ
	protected $salary;
	protected $thirst;
	protected $output;
	private $tier;
	private $isBig;
	
	//Давать доступ только через конструктор
	public function __construct($tier, $isBig){
		$this->tier = $tier;
		$this->isBig = $isBig;
	}
	
	//Выводит зарплату
	public function countTierSalary(){
		switch($this->tier){
			case 2 : 
				$this->salary += $this->salary * 0.25;
				break;
			case 3 :
				$this->salary += $this->salary * 0.5;
				break;
		}
		//Если крип- босс, то поднимаем оплату
		if($this->isBig == 1){
			$this->salary += $this->salary * 0.5;
		}
		return $this->salary;
	}
	
	//Выводит потребление
	public function countCreepThirst(){
		if($this->isBig == 1){
			$this->thirst += $this->thirst * 0.5;
		}
		return $this->thirst;
	}
	
	//Выводит выхлоп
	public function countCreepOutput(){
		if($this->isBig == 1){
			$this->output = 0;
		}
		return $this->output;
	}
}

//Менеджеры
class Manager extends Creep
{
	protected $salary = 500;
	protected $thirst = 20;
	protected $output = 200;
}

//Маркетологи
class Marketer extends Creep
{
	protected $salary = 400;
	protected $thirst = 15;
	protected $output = 150;
}

//Инженеры
class Engeneer extends Creep
{
	protected $salary = 200;
	protected $thirst = 5;
	protected $output = 15;
}

//Аналитики
class Analyst extends Creep
{
	protected $salary = 800;
	protected $thirst = 50;
	protected $output = 5;
}

//Запускаем тестового аналиста
$bob = new Analyst(2, 1);
print 	$bob->countTierSalary(). "\n".
		$bob->countCreepThirst(). "\n".
		$bob->countCreepOutput(). "\n";