Tetris/part.hpp

46 lines
636 B
C++
Raw Normal View History

2014-11-07 20:47:50 +01:00
#ifndef PART_HPP_INCLUDED
#define PART_HPP_INCLUDED
#include <iostream>
#include <SDL/SDL.h>
#include "resource.hpp"
#include "global.hpp"
using namespace std;
class part
{
private:
int shapeIndex;
int posX;
int posY;
void fillData();
protected:
int data[4][4];
int color;
public:
part();
void generate();
void move ( int x, int y );
void rotate();
bool isValid ( int xOffset = 0, int yOffset = 0 );
void draw ( SDL_Surface * screen );
void draw ( int startX, int startY, SDL_Surface * screen );
int getPosX();
int getPosY();
int getElement ( int x, int y );
int getColor();
};
#endif