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

namespace Rokojori
{ 
  public class ShaderVariant
  { 
    public string variantName = "";
    public List<ShaderCode> shaderCode = [];

    public string GetCode( ShaderGenerationContext context )
    {
      return shaderCode.Map( s => s.GetCode( context ) ).Join( "" );
    }

    public ShaderVariant Extend( ShaderCode shaderCode )
    {
      var variant = new ShaderVariant();
      variant.variantName = variantName + shaderCode.variantName;

      variant.shaderCode = this.shaderCode.Clone();
      variant.shaderCode.Add( shaderCode );

      return variant;
    }
  }

}