//@STATE=嶌惉拞
//@DESCRIPTION ---------------------------------------------------------------
// Ship.h: Ship 僋儔僗偺僀儞僞乕僼僃僀僗
// 摉傝敾掕偁偨傝偑偪傚偭偲傑傢傝偔偳偄偐側丏丏丏丅
//	棜楌丗
// $Log: MyShip.h,v $
// Revision 1.1  2001/10/28 21:40:36  fujiwara
// DLL偵暘妱
//
// Revision 1.5  2001/07/09 20:30:09  fujiwara
// 椺奜張棟偺慻傒崬傒
//
// Revision 1.4  2001/06/10 21:17:01  fujiwara
// 僞乕僎僢僩捛壛乮抧忋梡乯
//
// Revision 1.3  2001/05/12 00:49:34  fujiwara
// 俠倁俽傪摫擖偟丄儘僌昞帵傪捛壛
//
//@DESCRIPTION_END -----------------------------------------------------------
//@AUTHOR=S.F.
// Copyright (C) 2000 Satoshi Fujiwara. All Rights Reserved.
///////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MYSHIP_H__97EA7373_4E0F_416E_9888_3AB874F5B372__INCLUDED_)
#define AFX_MYSHIP_H__97EA7373_4E0F_416E_9888_3AB874F5B372__INCLUDED_

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

#include "character.h"
namespace sf {
	namespace application {
//		namespace scene {
//			class Game;
//		}

		using namespace sf::system;
namespace player {
class Target;

// 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅
// 帺婡僋儔僗掕媊 
// 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅
class Ship : public Character  
{
public:
	Ship();
	Ship(scene::Game *pGame);
	virtual ~Ship();
	// OPERATIONS //
	void initialize();
	void move(void);
	void restart(void);
	// 拞怱嵗昗
	const float x(void){return mX;};
	void x(const float value){mX = value;};

	const float y(void){return mY;};
	void y(const float value){mY = value;};

	const float z(void){return mZ;};
	void z(const float value){mZ = value;};
	// 儔僀僼	
	const int life(void){return mLife;};
	void life(const int value){mLife = value;};
	// 堏摦僗僺乕僪
	const float speed(void){return mMoveSpeed;};
	void speed(const float value){mMoveSpeed = value;};
	// 堏摦曽岦 (儔僕傾儞乯
	const float direction(void){return mMoveDirection;};
	void direction(const float value){mMoveDirection = value;};
	
	const bool hitCheck(Character * const pDest){
		if(mShipHitArea.check(pDest->hitObj())){
			hit(pDest);
			pDest->hit(this);
			return true;
		};
		return false;
	};

	const bool hitCheck(Characters * const pDest){
		return pDest->hitCheck(this);
	};

	void hit(Character * const pDest);
	sf::application::hit::Interface * const hitObj(void){return &mShipHitArea;};

	void visibility(const bool value){mBody.visibility(value);};
	const bool visibility(void){return mBody.visibility();};
	
	static const int INIT_LIFE;
private:
	enum STATE {
		MOVE,
		DEAD
	} mState;

	float mX,mY,mZ;
	int mLife;
	float mMoveSpeed,mMoveDirection;
	System* mpSystem;
	console::Console* mpConsole;
	input::Input* mpInput;
	sound::Sound* mpSound;

	console::ObjRectangle mBody;
	console::sprite::Sprite * mpSpriteShip;
	Target * mpTarget;
	scene::Game *mpGame;
	hit::HitRect mShipHitArea;
	int mTimer;
	int mCounter;
	static const console::sprite::Info INFO_BODY;
	static const float BODY_WIDTH;
	static const float BODY_HEIGHT;

	static const float INIT_X;
	static const float INIT_Y;
	static const float INIT_Z;
	
	static const float INIT_SPEED;
	static const int PATTERN_MAX;
	static const int PATTERN_MIDDLE;

};// Ship()


		}// player
	} // application
}// sf

#endif // !defined(AFX_MYSHIP_H__97EA7373_4E0F_416E_9888_3AB874F5B372__INCLUDED_)
