package com.haru.input;

import java.awt.Point;


public class InputBuffer {

	// 回転の向き
	public static final int R_NO = 0;
	public static final int R_RIGHT = 1;
	public static final int R_LEFT = -1;

	public static final int TRUE = 1;
	public static final int FALSE = 0;

	//---------------------------------------------------------------------------//
	// int[]での受け渡し
	//---------------------------------------------------------------------------//
	/**
	 * 移動の方向
	 */
	protected Point dir;
	/**
	 *  回転の向き
	 */
	protected int d_t;
	/**
	 * ハードドロップ
	 */
	protected int isDrop;


	private static final int LENGTH = 4; // 情報の数


	public InputBuffer() {
		dir = new Point();
		setKeyInit();
	}



	private void setKeyInit() {
		dir.x = dir.y = 0;
		d_t = InputBuffer.R_NO;
		isDrop = InputBuffer.FALSE;
	}

	public int[] read() {
		int[] ret = {dir.x, dir.y, d_t, isDrop};
		setKeyInit();
		return ret;
	}


	public int getLength() {
		return LENGTH;
	}

}
