-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSuperpage4x2.cs
36 lines (30 loc) · 1.03 KB
/
Superpage4x2.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
namespace pocketmodise {
using System;
internal class Superpage4x2 : AbstractSuperpageLayout {
public override uint Columns { get { return 4; } }
public override uint Rows { get { return 2; } }
public override bool IsLeftBorderDotted(uint x, uint y) {
return false;
}
public override bool IsTopBorderDotted(uint x, uint y) {
return (y == 1) && (x >= 1 && x <= 2);
}
public override SubpageLayout GetSubpageLayout(uint i) {
if(i > Count) throw new ArgumentException("index out of range");
var j = (i + 3) % 8;
var x = j % 4;
var y = j / 4;
var upside = Facing.Up;
if (y == 1) {
upside = Facing.Down;
x = 3 - x;
}
return new SubpageLayout() {
X = x,
Y = y,
SuperpageLayout = this,
Upside = upside
};
}
}
}