-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIBlock.cs
More file actions
20 lines (13 loc) · 806 Bytes
/
Copy pathIBlock.cs
File metadata and controls
20 lines (13 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
namespace Tetris_2._0 {
public class IBlock : Block { // aceasta clasa extinde clasa de baza Block
private readonly Position[][] tiles = new Position[][] {// salvam pozitiile (fiecarui patratel ce alcatuieste blockul) din fiecare stare de rotatie a blockului I
new Position[]{new(1,0),new(1,1),new(1,2),new(1,3) },
new Position[]{new(0,2),new(1,2),new(2,2),new(3,2) },
new Position[]{new(2,0),new(2,1),new(2,2),new(2,3) },
new Position[]{new(0,1),new(1,1),new(2,1),new(3,1) }
};
public override int id => 1;
protected override Position StartOffset => new Position(-1, 3);//blockul va fi creat pe mijlocul primului rand
protected override Position[][] Tiles => tiles; //updatam matricea grid-ului
}
}