Tetris/ShapesData.cs
2024-11-13 16:39:36 +01:00

120 lines
3.2 KiB
C#
Executable File

namespace Tetris;
public static class ShapesData
{
public static readonly List<List<int[,]>> shapes = new List<List<int[,]>>
{
// Square block (only one rotation)
new List<int[,]>
{
new int[,]
{
{0, 0}, {0, 1}, {0, 2}, {0, 3}, {1, 0}, {1, 1}, {1, 2}, {1, 3}
}
},
// Long block (two rotations)
new List<int[,]>
{
new int[,]
{
{1, 0}, {1, 1}, {1, 2}, {1, 3}, {1, -1}, {1, -2}, {1, 4}, {1, 5}
},
new int[,]
{
{0, 0}, {1, 0}, {2, 0}, {3, 0}, {0, 1}, {1, 1}, {2, 1}, {3, 1}
}
},
// L block right (four rotations)
new List<int[,]>
{
new int[,]
{
{0, -2}, {0, -1}, {0, 0}, {0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}
},
new int[,]
{
{1, -2}, {1, -1}, {1, 0}, {1, 1}, {0, 0}, {0, 1}, {-1, 0}, {-1, 1}
},
new int[,]
{
{1, -2}, {1, -1}, {1, 0}, {1, 1}, {1, 2}, {1, 3}, {0, -2}, {0, -1}
},
new int[,]
{
{-1, 0}, {-1, 1}, {1, 0}, {1, 1}, {0, 0}, {0, 1}, {-1, 2}, {-1, 3}
}
},
// L block left (four rotations)
new List<int[,]>
{
new int[,]
{
{0, -2}, {0, -1}, {0, 0}, {0, 1}, {0, 2}, {0, 3}, {1, -2}, {1, -1}
},
new int[,]
{
{-1, 0}, {-1, 1}, {1, 0}, {1, 1}, {0, 0}, {0, 1}, {-1, -1}, {-1, -2}
},
new int[,]
{
{1, -2}, {1, -1}, {1, 0}, {1, 1}, {1, 2}, {1, 3}, {0, 2}, {0, 3}
},
new int[,]
{
{-1, 0}, {-1, 1}, {1, 0}, {1, 1}, {0, 0}, {0, 1}, {1, 2}, {1, 3}
}
},
// Z block left (two rotations)
new List<int[,]>
{
new int[,]
{
{1, -2}, {1, -1}, {0, 0}, {0, 1}, {1, 0}, {1, 1}, {0, 2}, {0, 3}
},
new int[,]
{
{0, 0}, {0, 1}, {1, 0}, {1, 1}, {0, -1}, {0, -2}, {-1, -1}, {-1, -2}
}
},
// T block (four rotations)
new List<int[,]>
{
new int[,]
{
{0, -2}, {0, -1}, {0, 0}, {0, 1}, {0, 2}, {0, 3}, {1, 0}, {1, 1}
},
new int[,]
{
{-1, 0}, {-1, 1}, {0, 0}, {0, 1}, {1, 0}, {1, 1}, {0, -1}, {0, -2}
},
new int[,]
{
{1,-2}, {1,-1}, {1,0}, {1,1}, {1, 2}, {1, 3}, {0, 0}, {0, 1}
},
new int[,]
{
{-1, 0}, {-1, 1}, {0, 0}, {0, 1}, {1, 0}, {1, 1}, {0, 2}, {0, 3}
}
},
// Z block right (two rotations)
new List<int[,]>
{
new int[,]
{
{0, -2}, {0, -1}, {0, 0}, {0, 1}, {1, 0}, {1, 1}, {1, 2}, {1, 3}
},
new int[,]
{
{0, 0}, {0, 1}, {1, 0}, {1, 1}, {0, 2}, {0, 3}, {-1 , 2}, {-1, 3}
}
}
};
}