public IMaterial SetRequiredTool(ItemType type, ItemMaterial material = ItemMaterial.Any) { _requiredTool = type; _requiredMaterial = material; return(this); }
public bool CanUseTool(ItemType type, ItemMaterial material) { bool hasRequiredType = _requiredTool == type || _requiredTool.HasFlag(type); bool hasRequiredMaterial = _requiredMaterial == material || _requiredMaterial.HasFlag(material) || (material > _requiredMaterial); return(hasRequiredType && hasRequiredMaterial); }