#include "cGame.h"
#include "cSign.h"
#include "MediaVars.h"

cSign::cSign(cGame *g, double xx, double yy, std::string msg, bool read)
{
	hasBeenRead = read;
	game = g;
	x = xx;
	y = yy;
	depth = 0;
	collide.SetPosition(xx,yy);
	collide.SetLeft(22);
	collide.SetTop(44);
	collide.SetRight(39);
	collide.SetBottom(64);
	objectType = SIGN;
	depth = (collide.GetY()+20);
	destroyed = false;
	message = msg;
}

void cSign::Update()
{
}

void cSign::Draw()
{
	sprSign->SetPosition((float)(int)x,(float)(int)y);
	game->GetWindow()->Draw(*sprSign);
}

void cSign::SetAsRead()
{
	if (!hasBeenRead)
	{
		hasBeenRead = true;
		game->StatIncrease(ST_SIGN);
		game->AddItemToObtainedVector(x,y);
	}
}

std::string cSign::GetMessage()
{
	return message;
}