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; }
public UnitConversionKeySlot(Unit from, Unit to) { this.fromType = from.UnitType; this.toType = to.UnitType; }
/// <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; }
/// <summary> /// Returns all registered units of the given type. /// </summary> public static IList<Unit> GetUnits(UnitType unitType) { return Instance.unitsByType[unitType]; }