/*!
* @file GameElement.cpp
* @brief ゲーム中要素のスーパークラス実装
* @date 2014/01/19
* @author Deskull
* 2014 Sikabane Works.
*/

#include "stdafx.h"
#include "GameElement.h"
#include "GameWorld.h"
#include "GameSurface.h"
#include "GameLogger.h"

namespace Deeangband
{
	GameWorld *GameElement::GameWorldPtr;
	GameSurface *GameElement::GameSurfacePtr;
	GameLogger *GameElement::GameLoggerPtr;

	GameElement::GameElement(void)
	{
		this->WipeData();
		return;
	}

	GameElement::~GameElement(void)
	{
		this->WipeData();
		return;
	}

	void GameElement::WipeData(void)
	{
		this->name = "";
		this->description = "";
		this->validGenerated = false;
	}

	NAME GameElement::GetName()
	{
		return this->name;
	}

	DESCRIPTION GameElement::GetDescription()
	{
		return this->description;
	}

	bool GameElement::IsValidGenerated(void)
	{
		return this->validGenerated;
	}


	std::string GameElement::WeightFormat(WEIGHT weight)
	{
		char buf[20];
		sprintf_s(buf, "%6.1fkg", weight);
		return std::string(&buf[0]);
	}

	std::string GameElement::HeightFormat(HEIGHT height)
	{
		char buf[20];
		sprintf_s(buf, "%6.2fm", height / 100.0f);
		return std::string(&buf[0]);
	}

}