Hopefully the last bulk update for relays. Also includes a bunch of commenting.
[AntennaRange.git] / ProtoAntennaRelay.cs
blob:a/ProtoAntennaRelay.cs -> blob:b/ProtoAntennaRelay.cs
--- a/ProtoAntennaRelay.cs
+++ b/ProtoAntennaRelay.cs
@@ -2,7 +2,11 @@
 
 namespace AntennaRange
 {
-	public class ProtoAntennaRelay : AntennaRelay
+	/*
+	 * Wrapper class for ProtoPartModuleSnapshot extending AntennaRelay and implementing IAntennaRelay.
+	 * This is used for finding relays in unloaded Vessels.
+	 * */
+	public class ProtoAntennaRelay : AntennaRelay, IAntennaRelay
 	{
 		protected ProtoPartModuleSnapshot snapshot;
 
@@ -20,6 +24,11 @@
 			}
 		}
 
+		/// <summary>
+		/// Gets a value indicating whether this <see cref="AntennaRange.ProtoDataTransmitter"/> has been checked during
+		/// the current relay attempt.
+		/// </summary>
+		/// <value><c>true</c> if relay checked; otherwise, <c>false</c>.</value>
 		public override bool relayChecked
 		{
 			get
@@ -30,10 +39,22 @@
 			}
 			protected set
 			{
-				this.snapshot.moduleValues.SetValue("relayChecked", value.ToString());
+				if (this.snapshot.moduleValues.HasValue("relayChecked"))
+				{
+					this.snapshot.moduleValues.SetValue("relayChecked", value.ToString ());
+				}
+				else
+				{
+					this.snapshot.moduleValues.AddValue("relayChecked", value);
+				}
 			}
 		}
 
+		/// <summary>
+		/// Initializes a new instance of the <see cref="AntennaRange.ProtoAntennaRelay"/> class.
+		/// </summary>
+		/// <param name="ms">The ProtoPartModuleSnapshot to wrap</param>
+		/// <param name="vessel">The parent Vessel</param>
 		public ProtoAntennaRelay(ProtoPartModuleSnapshot ms, Vessel vessel) : base(vessel)
 		{
 			this.snapshot = ms;