// Author : Chris Tolley
// Date   : 7/13/2004
// Object.h contains the class declaration for an abstract base class
// to use as the base for all game objects

#if !defined(AFX_OBJECT_H__6FBD6848_C2B9_44A2_B820_2DD808DD1198__INCLUDED_)
#define AFX_OBJECT_H__6FBD6848_C2B9_44A2_B820_2DD808DD1198__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>
using std::string;

#include "matrix.h"

class Object  
{
public:
	// Constructor
	Object();

	// Destructor
	virtual ~Object();

	// Updates the object.  Must be implemented at a derived level
	virtual void Update( float elapsedSec ) = 0;

	// Renders the object to the screen. Must be implemented at a derived level
	virtual void Render() = 0;

	// Returns true if this Object is inside the sphere
	virtual bool InSphere( float x, float z, float radius ) = 0;

	// Returns a value indicating the type of object this object is
	virtual inline string GetType() = 0;

	// Returns true if it is time for this object to be removed
	virtual bool TimeToDie() = 0;

	// Returns this object's local coordinate system
	inline matrix* GetCoordSystem() { return &m_mLocal; };

	// Performs a translation in this objects local coordinate system
	virtual void Translate( const float x, const float y, const float z );
	virtual void Translate( const float* tran );

	// Performs a rotation in this object's local coordinate system
	virtual void Rotate( const float x, const float y, const float z );
	virtual void Rotate( const float* rot );

	// Performs a Scale on this object's local coordinate system
	virtual void Scale( const float x, const float y, const float z );
	virtual void Scale( const float* sca );

	// Returns this object's position and store's it in x,y,z
	virtual void GetPos( float& x, float& y, float& z );

	// Returns this object's unique id number
	inline unsigned int GetId() const { return m_iID; };

	// Returns true if this object and rhs have the same id
	inline bool operator== ( const Object& rhs ) const
	{ return m_iID == rhs.m_iID; };

	// Return true if this object and rhs don't have the same id
	inline bool operator!= ( const Object& rhs ) const
	{ return m_iID != rhs.m_iID; };
protected:
	// The local coordinate system for this object
	matrix m_mLocal;

	// A unique id for each object
	unsigned int m_iID;

	// Generates the id's for each object
	static unsigned int m_iIdGenerator;
};

#endif // !defined(AFX_OBJECT_H__6FBD6848_C2B9_44A2_B820_2DD808DD1198__INCLUDED_)
