
public static class MainSettings
{
	private var _timeLeft = 60;

	private var _scrollSpeed: float = -1;
	
	private var _toLoad: int = -1;
	
	private var _xPos = 0;
	
	private var _playername: String = "";
	
	private var _score: int = 0;
	
	private var _fuel: int = 10000;
	
	private var _lives: int = 3;
	
	private var _invincibilities: int = 1;
	
	private var _isInvincible: boolean = false;
	
	private var _playerid:int = 2;
	
	public function GetTimeLeft(shouldDeduct: boolean)
	{
		if(shouldDeduct)
		{
			_timeLeft = _timeLeft -1;
			return _timeLeft;
		}
		else
		{
			return _timeLeft;
		}
	}
	
	public function SetTimeLeft(time: int)
	{
		_timeLeft = time;
	}
	
	public function ResetTime()
	{
		_timeLeft = 60;
	}
	
	public function GetToLoad()
	{
		return _toLoad;
	}
	
	public function SetToLoad(ToLoad: int)
	{
		_toLoad = ToLoad;
	}
	
	public function SetXpos(xpos)
	{
		_xPos = xpos;
	}
	
	public function GetXpos()
	{
		return _xPos;
	}
	
	public function GetPlayerId()
	{
		return _playerid;
	}
	
	public function SetPlayerId(Id: int)
	{
		_playerid = Id;
	}
	
	public function GetPlayerName()
	{
		return _playername;
	}
	
	public function SetPlayerName(PlayerName:String)
	{
		_playername = PlayerName;
	}
	
	public function GetInvincibilities()
	{
		return _invincibilities;
	}
	
	public function SetInvincibilities(Invincibilities: int)
	{
		_invincibilities = Invincibilities;
	}
	
	public function Reset()
	{
		_score = 0;
		_fuel = 10000;
		_lives = 3;
		_invincibilities = 1;
		_isInvincible = false;
		_timeLeft = 60;
	}
	
	public function SoftReset()
	{
		_fuel = 10000;
		_isInvincible = false;
		_timeLeft = 60;
	}
	
	public function AddInvincibility()
	{
		_invincibilities++;
	}
	
	public function IsInvincible()
	{
		return _isInvincible;
	}
		
		//TO CHECK
	public function SetInvincible(Invincible: boolean, ShouldDeduct: boolean)
	{
		_isInvincible = Invincible;
		if(ShouldDeduct)
		{
			_invincibilities --;
		}
	}
	
	
	public function GetLives()
	{
		return _lives;
	}
	
	public function SetLives(lives:int)
	{
		 _lives = lives;
	}
	public function LoseLife()
	{
		_lives--;	
	}
	
	public function GetScrollSpeed()
	{
		return _scrollSpeed;
	}
	
	public function SetScrollSpeed( ScrollSpeed: float) 
	{
		_scrollSpeed = ScrollSpeed;
	}
	
	public function GetScore()
	{
		return _score;
	}
	
	public function SetScore()
	{
		_score = Mathf.Ceil( (GetScore() + (Application.loadedLevel *100)) );
	}
	
	public function SetScore(score:int)
	{
		_score = score ;
	}
	
	public function AddScore(score: float)
	{
		_score = _score + score;
	}
	
	public function SetFuel(fuel:int)
	{
		_fuel = fuel;
	}
	
	public function GetFuel()
	{
		_fuel = _fuel - 5;
		return _fuel;
	}
	
	public function OutOfFuel()
	{
		if(_fuel > 0)
		{
			return false;
		}
		return true;
	}	
	
	public function ResetFuel()
	{
		_fuel = 10000;
	}
}
