コード例 #1
0
ファイル: UnitType.cs プロジェクト: codetuner/Arebis.Common
		public static UnitType operator /(UnitType left, UnitType right)
		{
			UnitType result = new UnitType(Math.Max(left.baseUnitIndices.Length, right.baseUnitIndices.Length));
			left.baseUnitIndices.CopyTo(result.baseUnitIndices, 0);
			for (int i = 0; i < right.baseUnitIndices.Length; i++)
				result.baseUnitIndices[i] -= right.baseUnitIndices[i];
			return result;
		}
コード例 #2
0
			public UnitConversionKeySlot(Unit from, Unit to)
			{
				this.fromType = from.UnitType;
				this.toType = to.UnitType;
			}
コード例 #3
0
ファイル: UnitType.cs プロジェクト: codetuner/Arebis.Common
		/// <summary>
		/// Returns the unit type raised to the specified power.
		/// </summary>
		public UnitType Power(int power)
		{
			UnitType result = new UnitType(this.baseUnitIndices);
			for (int i = 0; i < result.baseUnitIndices.Length; i++)
				result.baseUnitIndices[i] = (sbyte)(result.baseUnitIndices[i] * power);
			return result;
		}
コード例 #4
0
		/// <summary>
		/// Returns all registered units of the given type.
		/// </summary>
		public static IList<Unit> GetUnits(UnitType unitType)
		{
			return Instance.unitsByType[unitType];
		}