-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblocks.h
35 lines (31 loc) · 918 Bytes
/
blocks.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __BLOCKS_H
#define __BLOCKS_H
#include <stdlib.h>
#include <time.h>
typedef struct {
int x;
int y;
int height;
int width;
int currentRotation;
char*** rotations;
} blockDescriptor;
extern blockDescriptor* blocks[7];
int randInt(int lower, int upper);
void getBlockDimensionsForRotation(blockDescriptor* block, int* height, int* width);
void generateBlocks();
void freeBlocks();
blockDescriptor* randomBlock();
char*** allocBlockRotationsArray(blockDescriptor* block);
void freeBlockRotationsArray(blockDescriptor* block);
blockDescriptor* copyBlock(blockDescriptor* block);
void freeBlock(blockDescriptor* block);
blockDescriptor* newBlock(int height, int width);
blockDescriptor* newSquareBlock();
blockDescriptor* newColumnBlock();
blockDescriptor* newLLeftBlock();
blockDescriptor* newLRightBlock();
blockDescriptor* newSBlock();
blockDescriptor* newZBlock();
blockDescriptor* newTBlock();
#endif