#include "object.h"

using namespace std;

namespace CBK
{
	Object::Object(string& name, IDirect3DDevice9* device)
	{
		setDevice(device);
		isSelected = false;
		setName(name);
	}

	Object::Object(IDirect3DDevice9* device)
	{
		isSelected = false;
		setDevice(device);
	}

	Object::~Object(void)
	{
	}

	Object& Object::operator=(const Object& other)
	{
		setDevice(other.device);
		return *this;
	}

	Object& Object::setDevice(IDirect3DDevice9* device)
	{
		this->device = device;

		return *this;
	}

	Object& Object::load(const string& name, IDirect3DDevice9* param)
	{
		this->device = param;
		return load(name);
	}

	Object& Object::unselect()
	{
		return select(false);
	}

	Object& Object::select(const bool isSelected)
	{
		this->isSelected = isSelected;
		return *this;
	}

	const bool Object::selected(void) const
	{
		return isSelected;
	}
}