-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shapes.cs
42 lines (38 loc) · 1014 Bytes
/
Shapes.cs
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
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Frogtris
{
class Shapes
{
public int Width;
public int Height;
public int[,] Center;
public Image PIC;
private int[,] prevCenter;
public void TurnAroundShapes()
{
prevCenter = Center;
Center = new int[Width, Height];
for (int i = 0; i < Width; i++)
for (int j = 0; j < Height; j++)
Center[i, j] = prevCenter[Height - 1 - j, i];
var temp = Width;
Width = Height;
Height = temp;
}
public void Rollback()
{
Center = prevCenter;
var temp = Width;
Width = Height;
Height = temp;
}
}
}