示例#1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: @Override public int calculate(final Amend amend, final com.kx.sglm.core.model.IntNumberPropertyObject intNumberPropertyObject, final int amendValue)
		public override int calculate(Amend amend, IntNumberPropertyObject intNumberPropertyObject, int amendValue)
		{
			if (!this.isAccept(amend, intNumberPropertyObject))
			{
				throw new System.ArgumentException("property type is diffrent");
			}
			return amendValue;
		}
示例#2
0
		/// <summary>
		/// 计算该修正规则作用于
		/// </summary>
		/// <param name="intNumberPropertyObject"> </param>
		/// <param name="amendValue">
		/// @return </param>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: @Override public int calculate(final Amend amend, final com.kx.sglm.core.model.IntNumberPropertyObject intNumberPropertyObject, final int amendValue)
		public override int calculate(Amend amend, IntNumberPropertyObject intNumberPropertyObject, int amendValue)
		{
			if (!this.isAccept(amend, intNumberPropertyObject))
			{
				throw new System.ArgumentException("property type is diffrent");
			}
			float _percent = amendValue / 100.0f;
			return (int)(intNumberPropertyObject.get(amend.propertyIndex) * _percent);
		}
		/// <summary>
		/// 检查该规则是否可以接受
		/// </summary>
		/// <param name="amend"> </param>
		/// <param name="intNumberPropertyObject">
		/// @return </param>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: protected boolean isAccept(final Amend amend, final com.kx.sglm.core.model.IntNumberPropertyObject intNumberPropertyObject)
		protected internal virtual bool isAccept(Amend amend, IntNumberPropertyObject intNumberPropertyObject)
		{
			if (amend.propertyType != intNumberPropertyObject.PropertyType)
			{
				return false;
			}

			return true;
		}
示例#4
0
		/// <summary>
		/// 计算对基准属性baseProperty的属性修正规�?并将计算结果累加到interimProperty�?
		/// </summary>
		/// <param name="baseProperty"> </param>
		/// <param name="interimProperty"> </param>
		public virtual void amend(IntNumberPropertyObject baseProperty, IntNumberPropertyObject interimProperty)
		{
			int _amendValue = this.rule.calculate(this.amend_Renamed, baseProperty, (int) this.value);
			interimProperty.add(this.amend_Renamed.propertyIndex, _amendValue);
		}
		/// <summary>
		/// 计算该修正规则作用于numberPropertyObject后的结果
		/// </summary>
		/// <param name="intNumberPropertyObject"> </param>
		/// <param name="amendValue"> 修正�? </param>
		/// <returns> 返回该规则应用于numberPropertyObject后所产生的改变�? </returns>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public abstract int calculate(final Amend amend, final com.kx.sglm.core.model.IntNumberPropertyObject intNumberPropertyObject, final int amendValue);
		public abstract int calculate(Amend amend, IntNumberPropertyObject intNumberPropertyObject, int amendValue);