#include "E3DBillBoard.h"

namespace HPL {
namespace E3D {

E3DBillBoard::E3DBillBoard() {
	set_BillBoardID(-1);
	this->reset();
	set_LifeCounterMax(100);
	set_Velocity(D3DXVECTOR3(0,0,0 ) );
	set_Alive( FALSE );

}
E3DBillBoard::~E3DBillBoard() {
}

int E3DBillBoard::get_BillBoardID() {
	return this->m_nBillBoardID;
}
void E3DBillBoard::set_BillBoardID(int nBillBoardID ) {
	this->m_nBillBoardID = nBillBoardID;
}
int E3DBillBoard::get_LifeCounter() {
	return this->m_nLifeCounter;
}
int E3DBillBoard::get_LifeCounterMax() {
	return this->m_nLifeCounterMax;
}
VOID E3DBillBoard::get_Velocity(D3DXVECTOR3* vVelocity ) {
	*vVelocity = this->m_vVelocity;
}
BOOL E3DBillBoard::get_Alive() {
	return this->m_bAlive;
}
void E3DBillBoard::set_LifeCounterMax( int nLifeCounterMax ) {
	this->m_nLifeCounterMax = nLifeCounterMax;
}
void E3DBillBoard::set_Velocity( D3DXVECTOR3& vVelocity ) {
	this->m_vVelocity = vVelocity;
}
void E3DBillBoard::set_Alive( BOOL bAlive ) {
	this->m_bAlive = bAlive;
}
void E3DBillBoard::set_LifeCounter( int nLifeCounter ) {
	this->m_nLifeCounter = nLifeCounter;
}
/** 初期化する
  *
  */
void E3DBillBoard::reset() {
	this->set_LifeCounter( 0 );
}
/** 寿命をちじめる
  * @retval	TRUE	寿命が来た
  * @retval	FALSE	まだ死なない
  */
BOOL E3DBillBoard::step() {
	this->m_nLifeCounter ++;
	if( this->m_nLifeCounter >= this->m_nLifeCounterMax ) {
		this->set_Alive( FALSE );
		return TRUE;
	}
	return FALSE;
}


}
}