Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    TemplateGeneratorBase<TParameters> Class

    Namespace: Stride.Core.Assets.Templates
    Assembly: Stride.Core.Assets.dll

    Base implementation for ITemplateGenerator and ITemplateGenerator<TParameters>.

    System.Object → TemplateGeneratorBase<TParameters>
    Derived from TemplateGeneratorBase<TParameters>:

    public abstract class TemplateGeneratorBase<TParameters> : ITemplateGenerator<TParameters>, ITemplateGenerator where TParameters : TemplateGeneratorParameters
    Type Parameters
    Name Description
    TParameters

    The type of parameters this generator uses.

    Name Description
    Methods
    IsSupportingTemplate(TemplateDescription)

    Determines whether this generator is supporting the specified template

    PrepareForRun(TParameters)

    Prepares this generator with the specified parameters.

    Run(TParameters)

    Runs the generator with the given parameter.

    | Improve this Doc View Source

    Methods


    IsSupportingTemplate(TemplateDescription)

    Determines whether this generator is supporting the specified template

    public abstract bool IsSupportingTemplate(TemplateDescription templateDescription)
    Parameters
    Type Name Description
    TemplateDescription templateDescription

    The template description.

    Returns
    Type Description
    System.Boolean

    true if this generator is supporting the specified template; otherwise, false.


    PrepareForRun(TParameters)

    Prepares this generator with the specified parameters.

    public abstract Task<bool> PrepareForRun(TParameters parameters)
    Parameters
    Type Name Description
    TParameters parameters

    The parameters for the template generator.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    A task completing when the preparation is finished, with the result True if the preparation was successful, false otherwise.

    Remarks

    This method should be used to verify that the parameters are correct, and to ask user for additional information before running the template.


    Run(TParameters)

    Runs the generator with the given parameter.

    public abstract bool Run(TParameters parameters)
    Parameters
    Type Name Description
    TParameters parameters

    The parameters for the template generator.

    Returns
    Type Description
    System.Boolean

    True if the generation was successful, false otherwise.

    Remarks

    This method should work in unattended mode and should not ask user for information anymore.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation