forked from kielthecoder/CwsDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSystemSettings.cs
64 lines (52 loc) · 1.69 KB
/
SystemSettings.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
61
62
63
64
using System;
namespace CwsDemo
{
public class SystemSettings
{
public const int MaxInputs = 8;
public const int MaxOutputs = 8;
public string name { get; set; }
public string location { get; set; }
public string helpNumber { get; set; }
public string[] inputs { get; set; }
public string[] outputs { get; set; }
public SystemSettings()
{
inputs = new string[MaxInputs];
outputs = new string[MaxOutputs];
}
public void Reset()
{
name = "My Room";
location = "My Office";
helpNumber = "5555";
for (int i = 0; i < MaxInputs; i++)
{
inputs[i] = String.Format("Input {0}", i + 1);
}
for (int i = 0; i < MaxOutputs; i++)
{
outputs[i] = String.Format("Output {0}", i + 1);
}
}
public void Copy(SystemSettings newSettings)
{
if (newSettings.name != null)
name = newSettings.name;
if (newSettings.location != null)
location = newSettings.location;
if (newSettings.helpNumber != null)
helpNumber = newSettings.helpNumber;
for (int i = 0; i < newSettings.inputs.Length; i++)
{
if (newSettings.inputs[i] != null)
inputs[i] = newSettings.inputs[i];
}
for (int i = 0; i < newSettings.outputs.Length; i++)
{
if (newSettings.outputs[i] != null)
outputs[i] = newSettings.outputs[i];
}
}
}
}