Ejemplo n.º 1
0
		/// <summary>
		/// 将本对象的指定的属性拷贝对目标对象�?
		/// </summary>
		/// <param name="target"> 目标对象 </param>
		/// <param name="props"> 属性索�? </param>
		public virtual void copyTo(FloatNumberPropertyObject target, int[] props)
		{
			for (int i = 0; i < props.Length; i++)
			{
				target.set(props[i], this.get(props[i]));
			}
		}
Ejemplo n.º 2
0
		/// <summary>
		/// 向指定的参数拷贝数据
		/// </summary>
		/// <param name="target"> </param>
		/// <exception cref="IllegalArgumentException"> 如果target的对象类型与该类型不一�? </exception>
		public virtual void copyTo(FloatNumberPropertyObject target)
		{
			if (target.propertyType != this.propertyType)
			{
				throw new System.ArgumentException("Not the same property type.");
			}
			target.props.copyFrom(this.props);
		}
Ejemplo n.º 3
0
		/// <summary>
		/// 从指定的参数中拷贝数据到本身<br>
		/// 注:此方法change全部的Bit位,如果需要精确比较,请使�?<seealso cref="#copyFromAndCompare(FloatNumberPropertyObject)"/>
		/// </summary>
		/// <param name="src"> </param>
		/// <exception cref="IllegalArgumentException"> 如果src的对象类型与该类型不一�? </exception>
		/// <exception cref="IllegalStateException"> 如果该对象处于只读状�? </exception>
		public virtual void copyFrom(FloatNumberPropertyObject src)
		{
			if (src.propertyType != this.propertyType)
			{
				throw new System.ArgumentException("Not the same property type.");
			}
			if (!isReadOnly)
			{
				this.props.copyFrom(src.props);
			}
			else
			{
				throw new System.NotSupportedException("PROP_READONLY");
			}
		}
Ejemplo n.º 4
0
		/// <summary>
		/// 从本身减去将指定参数中的数据
		/// </summary>
		/// <param name="src"> </param>
		/// <exception cref="IllegalArgumentException"> 如果src的对象类型与该类型不一�? </exception>
		/// <exception cref="IllegalStateException"> 如果该对象处于只读状�? </exception>
		public virtual void dec(FloatNumberPropertyObject src)
		{
			addBySign(src, -1);
		}
Ejemplo n.º 5
0
		/// <summary>
		/// 将当前的修改标识填充到toPropObj�?
		/// <para>
		/// <b>注意:此方法只在战斗中使用,其它情况“不建议”使�?/b>
		/// </para>
		/// </summary>
		/// <param name="toPropObj"> </param>
		public virtual void fillChangedBit(FloatNumberPropertyObject toPropObj)
		{
			if (toPropObj.propertyType != this.propertyType)
			{
				throw new System.ArgumentException("Not the same property type.");
			}
			if (!isReadOnly)
			{
				this.props.fillChangedBit(toPropObj.props);
			}
			else
			{
				throw new System.NotSupportedException("PROP_READONLY");
			}
		}
Ejemplo n.º 6
0
		/// <summary>
		/// 拷贝并比�?br>
		/// 只设置改变的值的Bit�?如不关心change,请使用 <seealso cref="#copyFrom(FloatNumberPropertyObject)"/>
		/// </summary>
		/// <param name="src"> </param>
		/// <exception cref="IllegalArgumentException"> 如果src的对象类型与该类型不一�? </exception>
		/// <exception cref="IllegalStateException"> 如果该对象处于只读状�? </exception>
		public virtual void copyFromAndCompare(FloatNumberPropertyObject src)
		{
			if (src.propertyType != this.propertyType)
			{
				throw new System.ArgumentException("Not the same property type.");
			}
			int _size = this.size();
			for (int i = 0; i < _size; i++)
			{
				this.set(i, src.get(i));
			}
		}
Ejemplo n.º 7
0
		/// <summary>
		/// 为本身加上或减去将指定参数中的数�?
		/// </summary>
		/// <param name="src"> </param>
		/// <param name="sign"> 1 or -1 (�?�? </param>
		/// <exception cref="IllegalArgumentException"> 如果src的对象类型与该类型不一�? </exception>
		/// <exception cref="IllegalStateException"> 如果该对象处于只读状�? </exception>
		private void addBySign(FloatNumberPropertyObject src, int sign)
		{
			if (src.propertyType != this.propertyType)
			{
				throw new System.ArgumentException("Not the same property type.");
			}
			if (!isReadOnly)
			{
				for (int i = 0; i < size(); i++)
				{
					add(i, sign * src.get(i));
				}
			}
			else
			{
				throw new System.NotSupportedException("PROP_READONLY");
			}
		}