public static bool IsCreatureInvisible <TStringType>([NotNull] this CreatureDisplayInfoEntry <TStringType> entry) where TStringType : class { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } return(!IsCreatureInvisible <TStringType>(entry)); }
public static bool IsCreatureOpaque <TStringType>([NotNull] this CreatureDisplayInfoEntry <TStringType> entry) where TStringType : class { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } return(entry.CreatureModelAlpha == byte.MaxValue); }
public static IEnumerator <string> EnumerateValidTextureVariations([NotNull] this CreatureDisplayInfoEntry <string> entry) { foreach (var textureName in entry.TextureVariation) { if (!string.IsNullOrWhiteSpace(textureName)) { yield return(textureName); } } }
public static bool HasOverridenBloodLevel <TStringType>([NotNull] this CreatureDisplayInfoEntry <TStringType> entry) where TStringType : class { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } return(entry.BloodLevelIdOverride > 0); }
public static int CalculateBloodLevel <TStringType>([NotNull] this CreatureDisplayInfoEntry <TStringType> entry) where TStringType : class { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } if (HasOverridenBloodLevel(entry)) { return(entry.UnitBloodId); } else if (entry.Model != null) { return(entry.Model.BloodLevelId); } else { throw new InvalidOperationException($"TODO: Support in-memory DBC foreign key relationships."); } }