using Godot;
using System.Reflection;
using System.Collections.Generic;

namespace Rokojori
{ 
  public class CustomMaterialProperty<[MustBeVariant] T>
  { 
    public CustomMaterialProperty( CustomMaterial m, ShaderPropertyName n )
    {
      _material = m;
      _name = n;
    }

    CustomMaterial _material;
    ShaderPropertyName _name;

    public S GetPropertyName<S>() where S:ShaderPropertyName
    {
      return _name as S;
    }

    public T Get()
    {
      return _name._Get<T>( _material, default( T ) );
    }

    public void Set( T value )
    {
      _name._Set<T>( _material, value );
    }
        
  }
}