PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 0ms

/WorldView/Structures/MarkerSettings.cs

#
C# | 94 lines | 81 code | 13 blank | 0 comment | 4 complexity | 55577d36732afffa24c2e3c2619c8c06 MD5 | raw file
 1using System;
 2
 3namespace MoreTerra.Structures
 4{
 5	public class MarkerSettings
 6	{
 7		private Boolean drawMarker;
 8		private Boolean useFilter;
 9		private Int32 filterMin;
10		private Int32 filterMax;
11
12		#region Constructors
13		public MarkerSettings()
14		{
15			drawMarker = true;
16			useFilter = false;
17			filterMin = 1;
18			filterMax = 255;
19		}
20
21		public MarkerSettings(MarkerSettings copy)
22		{
23			drawMarker = copy.drawMarker;
24			useFilter = copy.useFilter;
25			filterMin = copy.filterMin;
26			filterMax = copy.filterMax;
27		}
28		#endregion
29
30		#region GetSet Functions
31		public Boolean Drawing
32		{
33			get
34			{
35				return drawMarker;
36			}
37			set
38			{
39				drawMarker = value;
40			}
41		}
42
43		public Boolean Filtering
44		{
45			get
46			{
47				return useFilter;
48			}
49			set
50			{
51				useFilter = value;
52			}
53		}
54
55		public Int32 Min
56		{
57			get
58			{
59				return filterMin;
60			}
61
62			set
63			{
64				if (value < 1)
65					value = 1;
66
67				if (value > filterMax)
68					value = filterMax;
69
70				filterMin = value;
71			}
72		}
73
74		public Int32 Max
75		{
76			get
77			{
78				return filterMax;
79			}
80
81			set
82			{
83				if (value < 0)
84					value = 0;
85
86				if (value < filterMin)
87					value =  filterMin;
88
89				filterMax = value;
90			}
91		}
92		#endregion
93	}
94}