#pragma once
#include <DxLib.h>
#include <Figure.h>
#include <string>
#include <list>

#define NULL_HANDLE -1

namespace DXFW
{
/// <summary>ゲームパッドの種類</summary>
enum class PadType
{
	KeyAndPad1 = DX_INPUT_KEY_PAD1,
	Pad1 = DX_INPUT_PAD1,
	Pad2 = DX_INPUT_PAD2,
	Pad3 = DX_INPUT_PAD3,
	Pad4 = DX_INPUT_PAD4,
	KeyBord = DX_INPUT_KEY
};
	
/// <summary>ゲームパッドコード</summary>
enum class PadCode : LONG64
{
	Down = PAD_INPUT_DOWN ,
	Left = PAD_INPUT_LEFT,
	Right = PAD_INPUT_RIGHT,
	Up = PAD_INPUT_UP,
	Button1 = PAD_INPUT_1,
	Button2 = PAD_INPUT_2,
	Button3 = PAD_INPUT_3,
	Button4 = PAD_INPUT_4,
	Button5 = PAD_INPUT_5,
	Button6 = PAD_INPUT_6,
	Button7 = PAD_INPUT_7,
	Button8 = PAD_INPUT_8,
	Button9 = PAD_INPUT_9,
	Button10 = PAD_INPUT_10,
	Button11 = PAD_INPUT_11,
	Button12 = PAD_INPUT_12,
	Button13 = PAD_INPUT_13,
	Button14 = PAD_INPUT_14,
	Button15 = PAD_INPUT_15,
	Button16 = PAD_INPUT_16,
	Button17 = PAD_INPUT_17,
	Button18 = PAD_INPUT_18,
	Button19 = PAD_INPUT_19,
	Button20 = PAD_INPUT_20,
	Button21 = PAD_INPUT_21,
	Button22 = PAD_INPUT_22,
	Button23 = PAD_INPUT_23,
	Button24 = PAD_INPUT_24,
	Button25 = PAD_INPUT_25,
	Button26 = PAD_INPUT_26,
	Button27 = PAD_INPUT_27,
	Button28 = PAD_INPUT_28
};
	
/// <summary>キーボードコード</summary>
enum class KeyCode
{
	Null = -1,
	Back = KEY_INPUT_BACK,
	Tab = KEY_INPUT_TAB,
	Return = KEY_INPUT_RETURN,
	LShift = KEY_INPUT_LSHIFT,
	RShift = KEY_INPUT_RSHIFT,
	LControl = KEY_INPUT_LCONTROL,
	RControl = KEY_INPUT_RCONTROL,
	Escape = KEY_INPUT_ESCAPE,
	Space = KEY_INPUT_SPACE,
	PageUp = KEY_INPUT_PGUP,
	PageDown = KEY_INPUT_PGDN,
	End = KEY_INPUT_END,
	Home = KEY_INPUT_HOME,
	Left = KEY_INPUT_LEFT,
	Up = KEY_INPUT_UP,
	Right = KEY_INPUT_RIGHT,
	Down = KEY_INPUT_DOWN,
	Insert = KEY_INPUT_INSERT,
	Delete = KEY_INPUT_DELETE,

	Minus = KEY_INPUT_MINUS,
	Yen = KEY_INPUT_YEN,
	PrevTrack = KEY_INPUT_PREVTRACK,
	Period = KEY_INPUT_PERIOD,
	Slash = KEY_INPUT_SLASH,
	LAlt = KEY_INPUT_LALT,
	RAlt = KEY_INPUT_RALT,
	Scroll = KEY_INPUT_SCROLL,
	Semicolon = KEY_INPUT_SEMICOLON,
	Colon = KEY_INPUT_COLON,
	LBracket = KEY_INPUT_LBRACKET,
	RBracket = KEY_INPUT_RBRACKET,
	At = KEY_INPUT_AT,
	Backslash = KEY_INPUT_BACKSLASH,
	Comma = KEY_INPUT_COMMA,
	Capslock = KEY_INPUT_CAPSLOCK,
	Pause = KEY_INPUT_PAUSE,

	Numpad0 = KEY_INPUT_NUMPAD0,
	Numpad1 = KEY_INPUT_NUMPAD1,
	Numpad2 = KEY_INPUT_NUMPAD2,
	Numpad3 = KEY_INPUT_NUMPAD3,
	Numpad4 = KEY_INPUT_NUMPAD4,
	Numpad5 = KEY_INPUT_NUMPAD5,
	Numpad6 = KEY_INPUT_NUMPAD6,
	Numpad7 = KEY_INPUT_NUMPAD7,
	Numpad8 = KEY_INPUT_NUMPAD8,
	Numpad9 = KEY_INPUT_NUMPAD9,
	Multiply = KEY_INPUT_MULTIPLY,
	Add = KEY_INPUT_ADD,
	Subtract = KEY_INPUT_SUBTRACT,
	Decimal = KEY_INPUT_DECIMAL,
	Divide = KEY_INPUT_DIVIDE,
	NUMPADEnter = KEY_INPUT_NUMPADENTER,

	F1 = KEY_INPUT_F1,
	F2 = KEY_INPUT_F2,
	F3 = KEY_INPUT_F3,
	F4 = KEY_INPUT_F4,
	F5 = KEY_INPUT_F5,
	F6 = KEY_INPUT_F6,
	F7 = KEY_INPUT_F7,
	F8 = KEY_INPUT_F8,
	F9 = KEY_INPUT_F9,
	F10 = KEY_INPUT_F10,
	F11 = KEY_INPUT_F11,
	F12 = KEY_INPUT_F12,

	A = KEY_INPUT_A,
	B = KEY_INPUT_B,
	C = KEY_INPUT_C,
	D = KEY_INPUT_D,
	E = KEY_INPUT_E,
	F = KEY_INPUT_F,
	G = KEY_INPUT_G,
	H = KEY_INPUT_H,
	I = KEY_INPUT_I,
	J = KEY_INPUT_J,
	K = KEY_INPUT_K,
	L = KEY_INPUT_L,
	M = KEY_INPUT_M,
	N = KEY_INPUT_N,
	O = KEY_INPUT_O,
	P = KEY_INPUT_P,
	Q = KEY_INPUT_Q,
	R = KEY_INPUT_R,
	S = KEY_INPUT_S,
	T = KEY_INPUT_T,
	U = KEY_INPUT_U,
	V = KEY_INPUT_V,
	W = KEY_INPUT_W,
	X = KEY_INPUT_X,
	Y = KEY_INPUT_Y,
	Z = KEY_INPUT_Z,
	_0 = KEY_INPUT_0,
	_1 = KEY_INPUT_1,
	_2 = KEY_INPUT_2,
	_3 = KEY_INPUT_3,
	_4 = KEY_INPUT_4,
	_5 = KEY_INPUT_5,
	_6 = KEY_INPUT_6,
	_7 = KEY_INPUT_7,
	_8 = KEY_INPUT_8,
	_9 = KEY_INPUT_9
};
	
/// <summary>マウスボタンコード</summary>
enum class MouseCode
{
	Left = MOUSE_INPUT_LEFT,
	Right = MOUSE_INPUT_RIGHT,
	Middle = MOUSE_INPUT_MIDDLE,
	_4 = MOUSE_INPUT_4,
	_5 = MOUSE_INPUT_5,
	_6 = MOUSE_INPUT_6,
	_7 = MOUSE_INPUT_7,
	_8 = MOUSE_INPUT_8
};

/// <summary>各ボタンとキーを表すクラス</summary>
class Key
{
public:
	bool on;//押した瞬間
	bool off;//離した瞬間
	bool hold;//押されている
	unsigned int  holdCount;//押されている時間

	Key() : 
		on(false),
		off(false),
		hold(false),
		holdCount(0)
	{}
			
	///<summary>キーのリセット</summary>
	void Reset()
	{
		on = false;
		off = false;
		hold = false;
		holdCount = 0;
	}

	///<summary>押下状態の更新</summary>
	void Update(int isHold)
	{
		if( !hold && isHold ) on = true;
		else						on = false;
		if( hold && !isHold ) off = true;
		else						off = false;

		if( isHold ){
			hold = true;
			holdCount++;
		}else{
			hold = false;
			holdCount = 0;
		}		
	}
};
	
///<summary>ジョイパッド入力</summary>
class Joypad
{
private:
	PadType inputType;
	Joypad(const Joypad &joypad);
	Joypad operator =(const Joypad &joypad);
public:
	Joypad(): 
		inputType(PadType::KeyAndPad1),
		StickX(0),
		StickY(0)
	{};

	~Joypad(){};

	Key Down;
	Key Left;
	Key Right;
	Key Up;
	Key Button1;
	Key Button2;
	Key Button3;
	Key Button4;
	Key Button5;
	Key Button6;
	Key Button7;
	Key Button8;
	Key Button9;
	Key Button10;
	Key Button11;
	Key Button12;
	Key Button13;
	Key Button14;
	Key Button15;
	Key Button16;
	Key Button17;
	Key Button18;
	Key Button19;
	Key Button20;
	Key Button21;
	Key Button22;
	Key Button23;
	Key Button24;
	Key Button25;
	Key Button26;
	Key Button27;
	Key Button28;

	int StickX;
	int StickY;

	///<summary>パッドの作成</summary>
	void Make(PadType パッドタイプ)
	{
		inputType = パッドタイプ;
	}
			
	///<summary>状態のリセット</summary>
	void Reset()
	{
		Up.Reset();
		Down.Reset();
		Left.Reset();
		Right.Reset();
		Button1.Reset();
		Button2.Reset();
		Button3.Reset();
		Button4.Reset();
		Button5.Reset();
		Button6.Reset();
		Button7.Reset();
		Button8.Reset();
		Button9.Reset();
		Button10.Reset();
		Button11.Reset();
		Button12.Reset();
		Button13.Reset();
		Button14.Reset();
		Button15.Reset();
		Button16.Reset();
		Button17.Reset();
		Button18.Reset();
		Button19.Reset();
		Button20.Reset();
		Button21.Reset();
		Button22.Reset();
		Button23.Reset();
		Button24.Reset();
		Button25.Reset();
		Button26.Reset();
		Button27.Reset();
		Button28.Reset();

		StickX = 0;
		StickY = 0;
	}
		
	///<summary>状態の更新</summary>
	bool Update()
	{
		const int N = DxLib::GetJoypadInputState( static_cast<int>(inputType)) ;		
		DxLib::GetJoypadAnalogInput( &StickX , &StickY, (int)inputType );
		Down.Update( N & (int)PadCode::Down);
		Left.Update( N & (int)PadCode::Left );
		Right.Update( N & (int)PadCode::Right );
		Up.Update( N & (int)PadCode::Up );
		Button1.Update( N & (int)PadCode::Button1 );
		Button2.Update( N & (int)PadCode::Button2 );
		Button3.Update( N & (int)PadCode::Button3 );
		Button4.Update( N & (int)PadCode::Button4 );
		Button5.Update( N & (int)PadCode::Button5 );
		Button6.Update( N & (int)PadCode::Button6 );
		Button7.Update( N & (int)PadCode::Button7 );
		Button8.Update( N & (int)PadCode::Button8 );
		Button9.Update( N & (int)PadCode::Button9 );
		Button10.Update( N & (int)PadCode::Button10 );
		Button11.Update( N & (int)PadCode::Button11 );
		Button12.Update( N & (int)PadCode::Button12 );
		Button13.Update( N & (int)PadCode::Button13 );
		Button14.Update( N & (int)PadCode::Button14 );
		Button15.Update( N & (int)PadCode::Button15 );
		Button16.Update( N & (int)PadCode::Button16 );
		Button17.Update( N & (int)PadCode::Button17 );
		Button18.Update( N & (int)PadCode::Button18 );
		Button19.Update( N & (int)PadCode::Button19 );
		Button20.Update( N & (int)PadCode::Button20 );
		Button21.Update( N & (int)PadCode::Button21 );
		Button22.Update( N & (int)PadCode::Button22 );
		Button23.Update( N & (int)PadCode::Button23 );
		Button24.Update( N & (int)PadCode::Button24 );
		Button25.Update( N & (int)PadCode::Button25 );
		Button26.Update( N & (int)PadCode::Button26 );
		Button27.Update( N & (int)PadCode::Button27 );
		Button28.Update( N & (LONG64)PadCode::Button28 );

		return true;
	}
			
	/// <summary>パッドタイプの取得</summary>
	PadType GetInputType()
	{
		return inputType;
	}
			
	/// <summary>パッドタイプの設定</summary>
	void SetInputType(PadType inputPudType)
	{
		inputType = inputPudType;
	}

	///<summary>キーのパッド割当て設定</summary>
	///第二引数以降のキーが押された時、指定したパッドのボタンを押されたと判定する
	bool SetInputToKey(PadCode padInput,KeyCode keyInput1 ,KeyCode keyInput2 = KeyCode::Null , KeyCode keyInput3 = KeyCode::Null,KeyCode keyInput4= KeyCode::Null)
	{
		return !DxLib::SetJoypadInputToKeyInput( (int)inputType , (int)padInput, (int)keyInput1, (int)keyInput2, (int)keyInput3, (int)keyInput4 ) ;
	}
			
	///<summary>パッドを振動させる</summary>
	///指定した強さ(0.0〜1.0)で指定ミリ秒パッドを振動させる
	///時間が-1の場合、StopVibration関数を呼ぶまで振動させる
	bool StartVibration(double power,int time)
	{
		return !DxLib::StartJoypadVibration( (int)inputType , int(power*1000), time ) ;
	}
	
	///<summary>パッドの振動を停止する</summary>
	bool StopVibration()
	{
		return !DxLib::StopJoypadVibration( (int)inputType ) ;
	}
		
	/// <summary>接続中のパッド数を取得</summary>
	static int GetCount()
	{
		return DxLib::GetJoypadNum();
	}
};
	
/// <summary>マウス入力</summary>
class Mouse
{
private:
	Mouse( const Mouse &mouse);
	Mouse operator =( const Mouse &mouse);
public:
	Mouse()
	{
		Reset();
	}

	int x;
	int y;

	int moveX;
	int moveY;

	int Whell;

	Key Left;
	Key Right;
	Key Middle;

	Key Button4;
	Key Button5;
	Key Button6;
	Key Button7;
	Key Button8;

	int maxButton;
	
	/// <summary>状態のリセット</summary>
	void Reset()
	{
		x = 0;
		y = 0;
		moveX = 0;
		moveY = 0;
		Left.Reset();
		Right.Reset();
		Middle.Reset();
		Button4.Reset();
		Button5.Reset();
		Button6.Reset();
		Button7.Reset();
		Button8.Reset();
		Whell = 0;
	}
		
	/// <summary>状態の更新</summary>
	bool Update()
	{
		int X,Y;
		DxLib::GetMousePoint(&X,&Y);
		moveX = X - x;
		moveY = Y - y;

		x = X;
		y = Y;

		int N = DxLib::GetMouseInput();

		Left.Update( N & (int)MouseCode::Left );
		Right.Update( N & (int)MouseCode::Right );
		Middle.Update( N & (int)MouseCode::Middle );

		Button4.Update( N & (int)MouseCode::_4 );
		Button5.Update( N & (int)MouseCode::_5 );
		Button6.Update( N & (int)MouseCode::_6 );
		Button7.Update( N & (int)MouseCode::_7 );
		Button8.Update( N & (int)MouseCode::_8 );

		return true;
	}

	///<summary>カーソルの表示設定</summary>
	bool SetVisible(bool 表示フラグ)
	{
		return !SetMouseDispFlag( 表示フラグ );
	}
	
	///<summary>カーソル位置を移動</summary>
	bool SetPoint( int x , int y )
	{
		return !SetMousePoint( x , y );
	}

};

/// <summary>キーボード入力</summary>
class Keyboard
{
private:
	Keyboard(const Keyboard &key);
	Keyboard& operator =(const Keyboard &key);
public:
	Keyboard(){};

	Key Back;
	Key Tab;
	Key Return;
	Key LShift;
	Key RShift;
	Key LControl;
	Key RControl;
	Key Escape;
	Key Space;
	Key PageUp;
	Key PageDown;
	Key End;
	Key Home;
	Key Left;
	Key Up;
	Key Right;
	Key Down;
	Key Insert;
	Key Delete;

	Key Minus;
	Key Yen;
	Key PrevTrack;
	Key Period;
	Key Slash;
	Key LAlt;
	Key RAlt;
	Key Scroll;
	Key Semicolon;
	Key Colon;
	Key LBracket;
	Key RBracket;
	Key At;
	Key Backslash;
	Key Comma;
	Key Capslock;
	Key Pause;

	Key Numpad0;
	Key Numpad1;
	Key Numpad2;
	Key Numpad3;
	Key Numpad4;
	Key Numpad5;
	Key Numpad6;
	Key Numpad7;
	Key Numpad8;
	Key Numpad9;
	Key Multiply;
	Key Add;
	Key Subtract;
	Key Decimal;
	Key Divide;
	Key NUMPADEnter;

	Key F1;
	Key F2;
	Key F3;
	Key F4;
	Key F5;
	Key F6;
	Key F7;
	Key F8;
	Key F9;
	Key F10;
	Key F11;
	Key F12;

	Key A;
	Key B;
	Key C;
	Key D;
	Key E;
	Key F;
	Key G;
	Key H;
	Key I;
	Key J;
	Key K;
	Key L;
	Key M;
	Key N;
	Key O;
	Key P;
	Key Q;
	Key R;
	Key S;
	Key T;
	Key U;
	Key V;
	Key W;
	Key X;
	Key Y;
	Key Z;
	Key _0;
	Key _1;
	Key _2;
	Key _3;
	Key _4;
	Key _5;
	Key _6;
	Key _7;
	Key _8;
	Key _9;
		
	/// <summary>状態のリセット</summary>
	void Reset()
	{
		Back.Reset();
		Tab.Reset();
		Return.Reset();
		LShift.Reset();
		RShift.Reset();
		LControl.Reset();
		RControl.Reset();
		Escape.Reset();
		Space.Reset();
		PageUp.Reset();
		PageDown.Reset();
		End.Reset();
		Home.Reset();
		Left.Reset();
		Up.Reset();
		Right.Reset();
		Down.Reset();
		Insert.Reset();
		Delete.Reset();

		Minus.Reset();
		Yen.Reset();
		PrevTrack.Reset();
		Period.Reset();
		Slash.Reset();
		LAlt.Reset();
		RAlt.Reset();
		Scroll.Reset();
		Semicolon.Reset();
		Colon.Reset();
		LBracket.Reset();
		RBracket.Reset();
		At.Reset();
		Backslash.Reset();
		Comma.Reset();
		Capslock.Reset();
		Pause.Reset();

		Numpad0.Reset();
		Numpad1.Reset();
		Numpad2.Reset();
		Numpad3.Reset();
		Numpad4.Reset();
		Numpad5.Reset();
		Numpad6.Reset();
		Numpad7.Reset();
		Numpad8.Reset();
		Numpad9.Reset();
		Multiply.Reset();
		Add.Reset();
		Subtract.Reset();
		Decimal.Reset();
		Divide.Reset();
		NUMPADEnter.Reset();

		F1.Reset();
		F2.Reset();
		F3.Reset();
		F4.Reset();
		F5.Reset();
		F6.Reset();
		F7.Reset();
		F8.Reset();
		F9.Reset();
		F10.Reset();
		F11.Reset();
		F12.Reset();

		A.Reset();
		B.Reset();
		C.Reset();
		D.Reset();
		E.Reset();
		F.Reset();
		G.Reset();
		H.Reset();
		I.Reset();
		J.Reset();
		K.Reset();
		L.Reset();
		M.Reset();
		N.Reset();
		O.Reset();
		P.Reset();
		Q.Reset();
		R.Reset();
		S.Reset();
		T.Reset();
		U.Reset();
		V.Reset();
		W.Reset();
		X.Reset();
		Y.Reset();
		Z.Reset();
		_0.Reset();
		_1.Reset();
		_2.Reset();
		_3.Reset();
		_4.Reset();
		_5.Reset();
		_6.Reset();
		_7.Reset();
		_8.Reset();
		_9.Reset();
	}
		
	/// <summary>状態の更新</summary>
	bool Update()
	{
		char Buf[ 256 ] ;
		DxLib::GetHitKeyStateAll( Buf );
	
		Back.Update( Buf[ (int)KeyCode::Back ] );
		Tab.Update( Buf[ (int)KeyCode::Tab ] );
		Return.Update( Buf[ (int)KeyCode::Return ] );
		LShift.Update( Buf[ (int)KeyCode::LShift ] );
		RShift.Update( Buf[ (int)KeyCode::RShift ] );
		LControl.Update( Buf[ (int)KeyCode::LControl ] );
		RControl.Update( Buf[ (int)KeyCode::RControl ] );
		Escape.Update( Buf[ (int)KeyCode::Escape ] );
		Space.Update( Buf[ (int)KeyCode::Space ] );
		PageUp.Update( Buf[ (int)KeyCode::PageUp ] );
		PageDown.Update( Buf[ (int)KeyCode::PageDown ] );
		End.Update( Buf[ (int)KeyCode::End ] );
		Home.Update( Buf[ (int)KeyCode::Home ] );
		Left.Update( Buf[ (int)KeyCode::Left ] );
		Up.Update( Buf[ (int)KeyCode::Up ] );
		Right.Update( Buf[ (int)KeyCode::Right ] );
		Down.Update( Buf[ (int)KeyCode::Down ] );
		Insert.Update( Buf[ (int)KeyCode::Insert ] );
		Delete.Update( Buf[ (int)KeyCode::Delete ] );

		Minus.Update( Buf[ (int)KeyCode::Minus ] );
		Yen.Update( Buf[ (int)KeyCode::Yen ] );
		PrevTrack.Update( Buf[ (int)KeyCode::PrevTrack ] );
		Period.Update( Buf[ (int)KeyCode::Period ] );
		Slash.Update( Buf[ (int)KeyCode::Slash ] );
		LAlt.Update( Buf[ (int)KeyCode::LAlt ] );
		RAlt.Update( Buf[ (int)KeyCode::RAlt ] );
		Scroll.Update( Buf[ (int)KeyCode::Scroll ] );
		Semicolon.Update( Buf[ (int)KeyCode::Semicolon ] );
		Colon.Update( Buf[ (int)KeyCode::Colon ] );
		LBracket.Update( Buf[ (int)KeyCode::LBracket ] );
		RBracket.Update( Buf[ (int)KeyCode::RBracket ] );
		At.Update( Buf[ (int)KeyCode::At ] );
		Backslash.Update( Buf[ (int)KeyCode::Backslash ] );
		Comma.Update( Buf[ (int)KeyCode::Comma ] );
		Capslock.Update( Buf[ (int)KeyCode::Capslock ] );
		Pause.Update( Buf[ (int)KeyCode::Pause ] );

		Numpad0.Update( Buf[ (int)KeyCode::Numpad0 ] );
		Numpad1.Update( Buf[ (int)KeyCode::Numpad1 ] );
		Numpad2.Update( Buf[ (int)KeyCode::Numpad2 ] );
		Numpad3.Update( Buf[ (int)KeyCode::Numpad3 ] );
		Numpad4.Update( Buf[ (int)KeyCode::Numpad4 ] );
		Numpad5.Update( Buf[ (int)KeyCode::Numpad5 ] );
		Numpad6.Update( Buf[ (int)KeyCode::Numpad6 ] );
		Numpad7.Update( Buf[ (int)KeyCode::Numpad7 ] );
		Numpad8.Update( Buf[ (int)KeyCode::Numpad8 ] );
		Numpad9.Update( Buf[ (int)KeyCode::Numpad9 ] );
		Multiply.Update( Buf[ (int)KeyCode::Multiply ] );
		Add.Update( Buf[ (int)KeyCode::Add ] );
		Subtract.Update( Buf[ (int)KeyCode::Subtract ] );
		Decimal.Update( Buf[ (int)KeyCode::Decimal ] );
		Divide.Update( Buf[ (int)KeyCode::Divide ] );
		NUMPADEnter.Update( Buf[ (int)KeyCode::NUMPADEnter ] );

		F1.Update( Buf[ (int)KeyCode::F1 ] );
		F2.Update( Buf[ (int)KeyCode::F2 ] );
		F3.Update( Buf[ (int)KeyCode::F3 ] );
		F4.Update( Buf[ (int)KeyCode::F4 ] );
		F5.Update( Buf[ (int)KeyCode::F5 ] );
		F6.Update( Buf[ (int)KeyCode::F6 ] );
		F7.Update( Buf[ (int)KeyCode::F7 ] );
		F8.Update( Buf[ (int)KeyCode::F8 ] );
		F9.Update( Buf[ (int)KeyCode::F9 ] );
		F10.Update( Buf[ (int)KeyCode::F10 ] );
		F11.Update( Buf[ (int)KeyCode::F11 ] );
		F12.Update( Buf[ (int)KeyCode::F12 ] );

		A.Update( Buf[ (int)KeyCode::A ] );
		B.Update( Buf[ (int)KeyCode::B ] );
		C.Update( Buf[ (int)KeyCode::C ] );
		D.Update( Buf[ (int)KeyCode::D ] );
		E.Update( Buf[ (int)KeyCode::E ] );
		F.Update( Buf[ (int)KeyCode::F ] );
		G.Update( Buf[ (int)KeyCode::G ] );
		H.Update( Buf[ (int)KeyCode::H ] );
		I.Update( Buf[ (int)KeyCode::I ] );
		J.Update( Buf[ (int)KeyCode::J ] );
		K.Update( Buf[ (int)KeyCode::K ] );
		L.Update( Buf[ (int)KeyCode::L ] );
		M.Update( Buf[ (int)KeyCode::M ] );
		N.Update( Buf[ (int)KeyCode::N ] );
		O.Update( Buf[ (int)KeyCode::O ] );
		P.Update( Buf[ (int)KeyCode::P ] );
		Q.Update( Buf[ (int)KeyCode::Q ] );
		R.Update( Buf[ (int)KeyCode::R ] );
		S.Update( Buf[ (int)KeyCode::S ] );
		T.Update( Buf[ (int)KeyCode::T ] );
		U.Update( Buf[ (int)KeyCode::U ] );
		V.Update( Buf[ (int)KeyCode::V ] );
		W.Update( Buf[ (int)KeyCode::W ] );
		X.Update( Buf[ (int)KeyCode::X ] );
		Y.Update( Buf[ (int)KeyCode::Y ] );
		Z.Update( Buf[ (int)KeyCode::Z ] );
		_0.Update( Buf[ (int)KeyCode::_0 ] );
		_1.Update( Buf[ (int)KeyCode::_1 ] );
		_2.Update( Buf[ (int)KeyCode::_2 ] );
		_3.Update( Buf[ (int)KeyCode::_3 ] );
		_4.Update( Buf[ (int)KeyCode::_4 ] );
		_5.Update( Buf[ (int)KeyCode::_5 ] );
		_6.Update( Buf[ (int)KeyCode::_6 ] );
		_7.Update( Buf[ (int)KeyCode::_7 ] );
		_8.Update( Buf[ (int)KeyCode::_8 ] );
		_9.Update( Buf[ (int)KeyCode::_9 ] );

		return true;
	}
	
	/// <summary>いずれかのキーが押されているか取得</summary>
	static bool HoldAnyKey()
	{
		return !DxLib::CheckHitKeyAll();
	}
				
};


/*
///<summary>文字バッファ入力</summary>
///文字入力バッファに溜まったデータを取得
///普通使わないので非実装
class KeyBuffer
{
private:
	KeyBuffer();
public:
	/// <summary>説明</summary>
	static char GetInputChar(bool isDelete = true)
	{
		return DxLib::GetInputChar( isDelete );
	}
		
	/// <summary>説明</summary>
	static int GetInputCharWait(bool isDelete = true)
	{
		return DxLib::GetInputCharWait( isDelete);
	}
	
	/// <summary>説明</summary>
	static int ClearInputCharBuf( void )
	{
		return DxLib::ClearInputCharBuf();
	}
};
*/

/// <summary>キーやマウスによる入力管理クラス</summary>
class Input
{
private:
	Input(){}
	~Input();

	static int handle;

public:
	static Joypad pad;
	static Mouse mouse;
	static Keyboard key;

	/// <summary>状態をリセット</summary>
	static void Reset()
	{
		Input::pad.Reset();
		Input::mouse.Reset();
		Input::key.Reset();
	}
	
	/// <summary>状態を更新</summary>
	static void Update()
	{
		Input::pad.Update();
		Input::mouse.Update();
		Input::key.Update();
	}
	
	///<summary>キーボードから文字を入力</summary>
	///文字入力ウィンドウを表示する
	///入力中は全ての処理が停止する
	///暫定実装
	static bool Text(int x,int y,int maxLength, char *str ,int isEscCancel ,bool isSingleOnly = false)
	{
		if( isSingleOnly )
		{
			return ( DxLib::KeyInputString( x , y ,maxLength , str , isEscCancel ) == 1 );
		}else{
			return ( DxLib::KeyInputSingleCharString( x , y ,maxLength , str , isEscCancel ) == 1 );
		}
	}
	
	///<summary>キーボードから数字を入力</summary>
	///数値入力ウィンドウを表示する
	///入力中は全ての処理が停止する
	///入力した値を返す
	///失敗した場合、範囲外の数値を返す
	static int Number(int x,int y,int min,int max,int isEscCancel)
	{
		return DxLib::KeyInputNumber( x , y , max , min , isEscCancel );
	}
	
	///<summary>テキスト入力モードの開始</summary>
	///他の処理を止めずに文字入力するモードを開始する
	static bool StartTextMode( int 最大文字数 , bool ESCキャンセル可能フラグ , bool 半角文字限定フラグ , bool 数値入力限定フラグ )
	{
		if( handle != NULL_HANDLE )
		{
			handle = DxLib::MakeKeyInput( 最大文字数 , ESCキャンセル可能フラグ , 半角文字限定フラグ , 数値入力限定フラグ );
		}
		DxLib::SetActiveKeyInput( handle );
	}
	
	///<summary>テキスト入力モードの確認</summary>
	static int CheckText()
	{
		return DxLib::CheckKeyInput( handle );
	}
	
	///<summary>テキストの描画</summary>
	static bool DrawText(int X座標 , int Y座標 )
	{
		DxLib::DrawKeyInputString( X座標 , Y座標 , handle );
	}
	
	///<summary>テキストの設定</summary>
	static bool SetText( const char* 文字列 )
	{
		DxLib::SetKeyInputString( 文字列 , handle );
	}
	static bool SetText( int 数値 )
	{
		DxLib::SetKeyInputNumber( 数値 , handle );
	}

	///<summary>テキストの取得</summary>
	static bool GetText( char* 出力バッファ )
	{
		return !GetKeyInputString( 出力バッファ , handle );
	}


	/*
	/// <summary>キーボード入力時の表示色設定</summary>
	static int SetKeyColor(int 入力文字色 , int IME非使用時カーソル色 ,
		int IME使用時文字色 , int IME使用時カーソル色 ,
		int 変換時下線色 , int IME使用時変換候補色 ,
		int 入力モード名色 , int 入力文字縁色 ,
		int 変換候補縁色 , int 入力モード名縁色 ,
		int 変換候補ウィンドウ縁色 , int 変換候補ウィンドウ色 ) 
	{
		return DxLib::SetKeyInputStringColor( nmlStr ,  nmlCur , imeStr ,  imeCur , imeLine ,  imeSelectStr , imeModeStr ,  nmlStrE , imeSelectStrE , imeModeStrE , imeSelectWinE , imeSelectWinF );
	}
	*/

};

}