예제 #1
0
 public static void CheckAttribute(this MagicEffectType effect, AttributeType attribute)
 {
     if (!effect.AffectsAttribute() && attribute != AttributeType.None)
     {
         throw new InvalidOperationException($"This effect does not affect an Attribute: {effect}");
     }
     if (attribute == AttributeType.None && effect.AffectsAttribute())
     {
         throw new InvalidOperationException($"Affected attribute required for this effect: {effect}");
     }
 }
예제 #2
0
 public static int IntConvertToAttributeId(this MagicEffectType effect, AttributeType attribute)
 {
     return(effect.AffectsAttribute() ? (int)attribute : INT_AFFECTED_ITEM_NONE);
 }
예제 #3
0
 public static AttributeType IntConvertToAttribute(this MagicEffectType effect, int id)
 {
     return(effect.AffectsAttribute() ? (AttributeType)id : AttributeType.None);
 }
예제 #4
0
 public static byte ByteConvertToAttributeId(this MagicEffectType effect, AttributeType attribute)
 {
     return(effect.AffectsAttribute() ? (byte)attribute : BYTE_AFFECTED_ITEM_NONE);
 }