#include "vector3d.h"
#include <stdio.h>      /* printf, scanf, puts, NULL */
#include <stdlib.h>     /* srand, rand */
#include <iostream>
#include <GL/glut.h>
#include <time.h>

using namespace std;
#pragma once


class Tetris
{
public:
	Tetris(void);
	~Tetris(void);

	enum tet_piece { Block, Line, L_piece, Three_piece};	
	tet_piece current_piece; 

	struct block_group{   // Declare PERSON struct type
		int x_1, x_2, x_3, x_4;
		int y_1, y_2, y_3, y_4;
	} current_block_info;   


	int score;
	int line_count;

	bool dropingPeice;
	int currentHeight;
	float drop_duration;
	float delta_t;
	float drop_counter;

	bool Grid_index_filled[10][22];
	vector3d Grid_Positions[10][22];

	void Generate_Grid();
	void Generate_Piece();
	
	void CheckForLine(); 
	void UpdateGrid();
	void DrawGrid(); 

	void MoveLeft();
	void MoveRight();

	void Update_timer(float temp_time);

};
