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
|
// Polygons.h
enum PolygonType {
PT_L_SHAPE = 0, // First polygon will be L-shaped
PT_T_SHAPE, // Second polygon will be T-shaped
PT_COUNT
};
int * GetPolygon(PolygonType Type);
// Polygons.cpp
int AllPolygons[PT_COUNT][25] = {
{ 0, 0, 1, 0, 0, // First polygon, L-shaped
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
0, 0, 1, 1, 0,
0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, // Second polygon, T-shaped
0, 1, 1, 1, 0,
0, 0, 1, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 0 }
};
int* GetPolygon(PolygonType Type)
{
if(Type >= PT_COUNT) // Invalid polygon chosen?
return 0;
return AllPolygons[Type];
}
|