-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClassAndStructPointPart2(struct).cs
60 lines (57 loc) · 1.18 KB
/
ClassAndStructPointPart2(struct).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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
namespace classANDstruct
{
public class PointC
{
public PointC()
{
X = 3;
Y = 5;
Color = ConsoleColor.Red;
Name = "Dot";
}
public PointC(int a):this()
{
X = a;
}
public PointC(int a,int b):this(a)
{
Y = b;
}
public PointC(int a, int b,string s):this(a,b)
{
Name = s;
}
public PointC(int a, int b, string s,ConsoleColor c):this(a,b,s)
{
color = c;
}
private int x;
private int y;
private string name;
private ConsoleColor color;
public int X { get => x; set => x = value; }
public ConsoleColor Color { get => color; set => color = value; }
public string Name { get => name; set => name = value; }
public int Y { get => y; set => y = value; }
/*
public int Y
{
set
{
if (value >= 0 && value < WindowHeight) y = value;
else
throw new Exception("ERROR VALUE"+value);
}
get
{
return y;
}
}
*/
}
}