Exemple #1
0
        public IMaterial SetRequiredTool(ItemType type, ItemMaterial material = ItemMaterial.Any)
        {
            _requiredTool     = type;
            _requiredMaterial = material;

            return(this);
        }
Exemple #2
0
        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);
        }