46 lines
636 B
C++
46 lines
636 B
C++
#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
|