package com.haru.component;

import java.io.Serializable;



public class GameField extends Field implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = -2105503342373285152L;
	public static final int WIDTH = 12;	// 10+2(壁);
	public static final int L = 1;
	public static final int R = 11;


	public static final int HEIGHT = 24; // 0〜3不可視,23(壁)

	public GameField() {
		map = new int[HEIGHT][WIDTH];
		for (int i = 0; i < HEIGHT - 1; i ++) {
			map[i][0] = TetraMino.T_WALL;
			map[i][WIDTH-1] = TetraMino.T_WALL;
		}
		for (int i = L; i < R; i ++) {
			map[HEIGHT-1][i] = TetraMino.T_WALL;

			//map[0][i] = Block.T_WALL; //debug
			putLine(0, TetraMino.T_WALL);
		}
	}





	public void putLine(int y, int type) {
		for (int x = L; x < R; x++) {
			map[y][x] = type;
		}
	}
	public void putLine(int y, int[] line) {
		map[y] = line;
	}
	public int[] getLine(int y) {
		return map[y].clone();
	}

	private boolean end = false;

	// 負けを認める
	public void setEnd() {
		end = true;
	}

	public boolean isEnd() {
		return end;
	}

}
