2025-03-19 23:47:17 +03:00
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace mROA.CodegenTools
|
|
|
|
|
{
|
2025-03-20 16:36:32 +03:00
|
|
|
public class ProgrammableTextSection : ITemplateSection
|
2025-03-19 23:47:17 +03:00
|
|
|
{
|
|
|
|
|
public TemplateDocument Context { get; set; }
|
|
|
|
|
public int TargetLength => 0;
|
|
|
|
|
|
|
|
|
|
private Func<object, string> _bakeFunc;
|
|
|
|
|
|
2025-03-20 16:36:32 +03:00
|
|
|
public ProgrammableTextSection(Func<object, string> bakeFunc, TemplateDocument context)
|
2025-03-19 23:47:17 +03:00
|
|
|
{
|
|
|
|
|
_bakeFunc = bakeFunc;
|
|
|
|
|
Context = context;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string Bake()
|
|
|
|
|
{
|
|
|
|
|
return _bakeFunc(Context.AdditionalContext);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|