
using Godot;
using System.Collections.Generic;

namespace Rokojori
{  
  public abstract class RG_BlendModeBase:RDShaderProcessor
  {
    public readonly CompositorEffectGraphTextureSlot top;
    public readonly CompositorEffectGraphTextureSlot mask;
    public readonly CompositorEffectGraphTextureSlot alphaMapping;
    public readonly CompositorEffectGraphTextureSlot bottom;
    public readonly CompositorEffectGraphTextureSlot output;

    public abstract RG_BlendModeType GetBlendModeType();     
    

    public RG_BlendModeBase( RDGraph graph, string shaderPath ):base( graph, shaderPath )
    {
      top    = new CompositorEffectGraphTextureSlot( this );
      mask   = new CompositorEffectGraphTextureSlot( this );
      alphaMapping = new CompositorEffectGraphTextureSlot( this );
      bottom = new CompositorEffectGraphTextureSlot( this );
      output = new CompositorEffectGraphTextureSlot( this );

      _textureSlots.AddRange( [ top, mask, alphaMapping, bottom, output ] );
    } 
    

    public void SetTextureSlotInputs( RDGraphTextureSlotInput topSlot, RDGraphTextureSlotInput maskSlot, RDGraphTextureSlotInput alphaSlot, RDGraphTextureSlotInput bottomSlot, RDGraphTextureSlotInput outputSlot )
    {
      topSlot.ConnectTo( top );
      maskSlot.ConnectTo( mask );
      alphaSlot.ConnectTo( alphaMapping );
      bottomSlot.ConnectTo( bottom );
      outputSlot.ConnectTo( output );
    }
    
  }
}