Consolidating some interface members to use RelayDataCost.
[AntennaRange.git] / ProtoAntennaRelay.cs
blob:a/ProtoAntennaRelay.cs -> blob:b/ProtoAntennaRelay.cs
--- a/ProtoAntennaRelay.cs
+++ b/ProtoAntennaRelay.cs
@@ -73,88 +73,31 @@
 		}
 
 		/// <summary>
-		/// Gets or sets the data capacity of a packet, in MiT/packet
-		/// </summary>
-		/// <value>The data capacity of a packet, in MiT/packet</value>
-		public float PacketSize
-		{
-			get
-			{
-				if (this.moduleRef == null)
-				{
-					return float.NaN;
-				}
-
-				return this.moduleRef.PacketSize;
-			}
-			set
-			{
-				if (this.moduleRef == null)
-				{
-					return;
-				}
-
-				this.moduleRef.PacketSize = value;
-			}
-		}
-
-		/// <summary>
-		/// Gets the base data capacity of a packet, in MiT/packet
-		/// </summary>
-		/// <value>The base data capacity of a packet, in MiT/packet</value>
-		public float BasePacketSize
-		{
-			get
-			{
-				if (this.moduleRef == null)
-				{
-					return float.NaN;
-				}
-
-				return this.moduleRef.BasePacketSize;
-			}
-		}
-
-		/// <summary>
-		/// Gets or sets the resource cost of a packet, in EC/packet
-		/// </summary>
-		/// <value>The resource cost of a packet, in EC/packet</value>
-		public float PacketResourceCost
-		{
-			get
-			{
-				if (this.moduleRef == null)
-				{
-					return float.NaN;
-				}
-
-				return this.moduleRef.PacketResourceCost;
-			}
-			set
-			{
-				if (this.moduleRef == null)
-				{
-					return;
-				}
-
-				this.moduleRef.PacketResourceCost = value;
-			}
-		}
-
-		/// <summary>
-		/// Gets the base resource cost of a packet, in EC/packet
-		/// </summary>
-		/// <value>The base resource cost of a packet, in EC/packet</value>
-		public float BasePacketResourceCost
-		{
-			get
-			{
-				if (this.moduleRef == null)
-				{
-					return float.NaN;
-				}
-
-				return this.moduleRef.BasePacketResourceCost;
+		/// Gets the base link resource rate in EC/MiT.
+		/// </summary>
+		/// <value>The base link resource rate in EC/MiT.</value>
+		public RelayDataCost BaseLinkCost
+		{
+			get;
+			private set;
+		}
+
+		/// <summary>
+		/// Override ModuleDataTransmitter.DataResourceCost to just return packetResourceCost, because we want antennas
+		/// to be scored in terms of joules/byte
+		/// </summary>
+		public double DataResourceCost
+		{
+			get
+			{
+				if (this.CanTransmit())
+				{
+					return this.moduleRef.DataResourceCost;
+				}
+				else
+				{
+					return float.PositiveInfinity;
+				}
 			}
 		}