#include "GBasePlayer.h"

#ifdef _DXLIB
#include "GStaticDataDX.h"

#else
#include "GStaticData.h"
#endif

using namespace std;
using namespace GEnum;

GBasePlayer::GBasePlayer() {
//	this->m_nWeaponSetType = 0;
	this->m_nForceID = -1;

	isJumpAccellerable = false;

}
void GBasePlayer::setup() {

	// スプライト設定
	for(int nSpriteID = SpriteType::EVIGEN; nSpriteID < SpriteType::MAX_NUM; nSpriteID ++){
#ifdef _DXLIB
		spriteList.push_back(staticData.m_Basic.m_Graphics.m_SpriteContainer.getSprite(nSpriteID)->clone());
#else
		spriteList.push_back(getStaticData()->getSprite(nSpriteID)->clone());
#endif
	}
	// 武器スプライト登録
#ifdef _DXLIB
	this->m_lpEvigenWeaponSprite = staticData.m_Basic.m_Graphics.m_SpriteContainer.getSprite( GEnum::SpriteType::EVIGEN_WEAPON )->clone();
	this->m_lpDurandalSprite = staticData.m_Basic.m_Graphics.m_SpriteContainer.getSprite( GEnum::SpriteType::DURANDAL )->clone();
	this->m_lpNakedPeseruSprite  = staticData.m_Basic.m_Graphics.m_SpriteContainer.getSprite( GEnum::SpriteType::NAKED_PESERU )->clone();
#else
	this->m_lpEvigenWeaponSprite = getStaticData()->getImageSetContainer()->getSprite( GEnum::SpriteType::EVIGEN_WEAPON )->clone();
	this->m_lpDurandalSprite = getStaticData()->getImageSetContainer()->getSprite( GEnum::SpriteType::DURANDAL )->clone();
	this->m_lpNakedPeseruSprite  = getStaticData()->getImageSetContainer()->getSprite( GEnum::SpriteType::NAKED_PESERU )->clone();
#endif

}

GBasePlayer::~GBasePlayer() {
	delete this->m_lpNakedPeseruSprite;
	delete this->m_lpDurandalSprite;
	delete this->m_lpEvigenWeaponSprite;
/*	delete biteMoveInterval;
	delete removeFearCounter;
	delete removeNennEkiCounter;
	delete removePoisonCounter;*/
	for(int i = 0; i < static_cast<int>(this->spriteList.size()); i ++){
		if(spriteList[i] != NULL){
			delete spriteList[i];
		}
	}
}

