-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint.cs
More file actions
104 lines (101 loc) · 2.1 KB
/
Point.cs
File metadata and controls
104 lines (101 loc) · 2.1 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
namespace MapGenerator
{
class Point
{
public Point(long xin, long yin)
{
x = xin;
y = yin;
}
public long x;
public long y;
public double value = 0;
private int r;
public int R
{
get {return r;}
set {
if (value < 0)
{
r = 0;
}
else if (value > 255)
{
r = 255;
}
else
{
r = value;
}
}
}
private int g;
public int G
{
get {return g;}
set {
if (value < 0)
{
g = 0;
}
else if (value > 255)
{
g = 255;
}
else
{
g = value;
}
}
}
private int b;
public int B
{
get {return b;}
set {
if (value < 0)
{
b = 0;
}
else if (value > 255)
{
b = 255;
}
else
{
b = value;
}
}
}
public void SetRGB(int channel, int value)
{
if (channel == 0)
{
R = value;
}
else if (channel == 1)
{
G = value;
}
else if (channel == 2)
{
B = value;
}
}
public void SetRGB(string channel, int value)
{
if (channel == "r")
{
R = value;
}
else if (channel == "g")
{
G = value;
}
else if (channel == "b")
{
B = value;
}
}
}
}