public bool CheckCompatibility(IUValueComponent uValueComponent)
 {
     if (Unrestricted)
     {
         return(true);
     }
     return(compatibleComponents.Contains(uValueComponent.GetType()));
 }
Пример #2
0
 public Layer(string name, Material material, double thickness, IUValueComponent parentComponent)
 {
     Name = name;
     if (!material.CheckCompatibility(parentComponent))
     {
         throw new ArgumentException("Incompatible material added to layer of component");
     }
     this.Material  = material;
     this.Thickness = thickness;
 }
        public IEnumerable <Material> GetCompatibleMaterials(IUValueComponent uValueComponent)
        {
            //Get materials from file

            throw new NotImplementedException();

            //Material material = new Material();

            //material.CheckCompatibility(uValueComponent);
        }
Пример #4
0
        public List <Material> GetCompatibleMaterials(IUValueComponent uValueComponent)
        {
            List <Material> compatibleMaterials = new List <Material>();

            foreach (Material material in materials)
            {
                if (material.CheckCompatibility(uValueComponent))
                {
                    compatibleMaterials.Add(material);
                }
            }
            return(compatibleMaterials);
        }
Пример #5
0
 public Layer(Material material, double thickness, IUValueComponent parentComponent) : this("Untitled Layer", material, thickness, parentComponent)
 {
 }
 public void RemoveCompatibleComponentType(IUValueComponent component)
 {
     compatibleComponents.Add(component.GetType());
 }
Пример #7
0
 public void RemoveComponent(IUValueComponent component)
 {
     Components.Remove(component);
 }
Пример #8
0
 public void AddComponent(IUValueComponent component)
 {
     Components.Add(component);
 }
Пример #9
0
 public bool CheckCompatibility(IUValueComponent uValueComponent)
 {
     return(Compatibility.CheckCompatibility(uValueComponent));
 }