Aura.Mabi.Structs.UpgradeEffect.SetStatCheck C# (CSharp) Method

SetStatCheck() public method

Changes effect to check a stat for a value.
public SetStatCheck ( UpgradeStat stat, UpgradeCheckType checkType, short value, UpgradeValueType valueType ) : void
stat UpgradeStat
checkType UpgradeCheckType
value short
valueType UpgradeValueType
return void
		public void SetStatCheck(UpgradeStat stat, UpgradeCheckType checkType, short value, UpgradeValueType valueType)
		{
			if (checkType < UpgradeCheckType.GreaterThan || checkType > UpgradeCheckType.Equal)
				throw new ArgumentException(checkType + " is not a stat check.");

			CheckType = checkType;
			CheckStat = stat;
			CheckValueType = valueType;
			CheckValue = value;
		}

Usage Example

コード例 #1
0
ファイル: UpgradeEffect.cs プロジェクト: tkiapril/aura
		public void UpgradeEffectStatCheck()
		{
			var effect = new UpgradeEffect(UpgradeType.Suffix);
			effect.SetStatCheck(UpgradeStat.MP, UpgradeCheckType.LowerEqualThan, 500, UpgradeValueType.Percent);
			Assert.Equal((
				"01 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00" +
				"00 00 00 00  0A 00 00 00  00 00 00 00  07 00 00 00" +
				"02 01 F4 01"
				).Replace(" ", ""), ToHex(effect));

			Assert.Throws(typeof(ArgumentException), () => effect.SetStatCheck(UpgradeStat.MP, UpgradeCheckType.SkillRankGreaterThan, 500, UpgradeValueType.Percent));
		}