#ifndef OBJECT_H
#define OBJECT_H

#include <string>
#include "d3dUtility.h"

#include <kLibrary\factory\factory.h>

namespace CBK
{
	class Object : public kLibrary::factory::Item<IDirect3DDevice9*>
	{
	public:
		//Create a new object
		Object(std::string& name, IDirect3DDevice9* device = 0);
		Object(IDirect3DDevice9* device = 0);

		//Clean up
		virtual ~Object(void);

		//Copies the object
		Object(const Object& other);
		Object& operator=(const Object& other);

		//Changes the device
		Object& setDevice(IDirect3DDevice9* device);

		//Loads the object
		virtual void apply(void) = 0;

		virtual Object& load(const std::string& name, IDirect3DDevice9* param);
		virtual Object& load(const std::string& name) = 0;

		virtual Object& reset(void) = 0;

		Object& select(const bool isSelected = true);
		Object& unselect();
		const bool selected(void) const;

	protected:
		bool isSelected;
		IDirect3DDevice9* device;

	private:
	};
}

#endif //OBJECT_H