public static bool Has(this Spell spell, SpellAttributesExB toCheck) { if (spell == null) return false; return (spell.AttributesExB & toCheck) == toCheck; }
public static bool Has(this Spell spell, SpellAttributesExB toCheck) { if (spell == null) { return(false); } return((spell.AttributesExB & toCheck) == toCheck); }
public static void FindAllWithAttributeExB(SpellAttributesExB attr) { var query = from spell in SpellHandler.ById where spell != null where spell.Has(attr) select spell; foreach (var spell in query) { Console.WriteLine("{0}: {1} - {2}", spell.Id, spell.Name, spell.AttributesExB); Console.WriteLine(); } Console.WriteLine("{0} spells have Attribute {1}", query.Count(), attr); Console.WriteLine(); }