//@STATE=嶌惉拞
//@DESCRIPTION ---------------------------------------------------------------
// MyGroundBullets.h: MyGroundBullets 僋儔僗偺僀儞僞乕僼僃僀僗
//	棜楌丗
// $Log: MyGroundBullets.h,v $
// Revision 1.1  2001/10/28 21:40:36  fujiwara
// DLL偵暘妱
//
// Revision 1.2  2001/07/09 20:30:09  fujiwara
// 椺奜張棟偺慻傒崬傒
//
// Revision 1.1  2001/06/10 21:17:34  fujiwara
// 抧忋梡捛壛
//
//@DESCRIPTION_END -----------------------------------------------------------
//@AUTHOR=S.F.
///////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MYGROUNDBULLETS_H__A11104A5_01DB_4B55_B2D4_04853C553E9C__INCLUDED_)
#define AFX_MYGROUNDBULLETS_H__A11104A5_01DB_4B55_B2D4_04853C553E9C__INCLUDED_

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

namespace sf {
	namespace application {
		namespace player {
			namespace bullet {

// 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅
// 帺抏掕媊 
// 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅

	const	int MAX_GROUNDBULLETS = 1;
	const	int MAX_GROUNDTYPE = 1;

class GroundBullets : public Characters {
	DECLARE_SINGLETON(GroundBullets)
	GroundBullets();
public:
	~GroundBullets();
	// Type 掕媊 //
	// 僆僽僕僃僋僩惗惉儊僜僢僪傊偺億僀儞僞 
	typedef Character * const (*CreateFuncPtr)(float,float,float,sf::application::scene::Game * const,int);
	// 僥僋僗僠儍儘乕僟傊偺億僀儞僞
	typedef void (*LoaderFuncPtr)(void);
	enum TYPE {
		NORMAL = 0
	};
	// OPERATIONS 
	void initialize();
	// 僉儍儔僋僞乕堏摦
	void move(void);

	const bool create(const TYPE id,const float x,const float y,const float z,sf::application::scene::Game * const pGame);
	const bool hitCheck(Character * const pDest);
	const bool hitCheck(Characters * const pDest);
	const void clear(int index){mpGroundBullets[index] = NULL ; mCount-- ;};
	//

private:
	Character *mpGroundBullets[MAX_GROUNDBULLETS];
	int mCount;
	int mMax;
	static const LoaderFuncPtr mpLoaders[MAX_GROUNDTYPE];
	static const int INIT_GROUNDBULLETS;
	static const CreateFuncPtr mpFunctions[MAX_GROUNDTYPE];
};// GroundBullets()

	// 
	const float GROUND_Z_OFFSET = 0.5f;
	
	// 僲乕儅儖抏 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅
	class GroundNormal : public sf::application::AbstractCharacter {
	public:
		// LIFECYCLE //
		GroundNormal(){};
		~GroundNormal(){ sf::application::player::bullet::GroundBullets::instance()->clear(index());};
		// OPERATORS //
		// OPERATIONS //
		void initialize();
		// 僉儍儔僋僞乕堏摦
		void move(void);

		// 拞怱嵗昗

		void hit(Character * const pDest){mHitRect.isChecking(false);mbHit = true;};

		static Character * const create(float x,float y ,float z,sf::application::scene::Game * const pGame,int index);
		static void load(void);
		
		// ACCESS //
		sf::application::hit::Interface * const hitObj(void){ return &mHitRect;};
		// INQUIRY //
	private:
		
		void main();
		void die();

		enum STATE {
			MOVE,
			BOMB
		} mState;
		hit::HitRect mHitRect;
		bool mbHit;
		float mOffsetY;
		float mAccel;
		int mTimer;

		sf::system::console::ObjRectangle mObj;
		sf::system::console::ObjRectangle mObjTarget;
		
		static int mSoundID;
		static std::auto_ptr<sf::system::console::sprite::Sprite> mpSprite;
		static const console::sprite::Info mSpriteInfo;
		static const float mTextureWidth;
		static const float mTextureHeight;
		
		static const float INIT_SPEED;
		static const float INIT_ACCEL;
	};// GroundNormal 

};
		}	
	}
}

#endif // !defined(AFX_MYGROUNDBULLETS_H__A11104A5_01DB_4B55_B2D4_04853C553E9C__INCLUDED_)
