Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ITemplateGenerator.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.Assets.Templates
6 {
7  /// <summary>
8  /// A template generator.
9  /// </summary>
10  public interface ITemplateGenerator
11  {
12  /// <summary>
13  /// Determines whether this generator is supporting the specified template
14  /// </summary>
15  /// <param name="templateDescription">The template description.</param>
16  /// <returns><c>true</c> if this generator is supporting the specified template; otherwise, <c>false</c>.</returns>
17  bool IsSupportingTemplate(TemplateDescription templateDescription);
18 
19  /// <summary>
20  /// Prepares this generator with the specified parameters and return a runnable action that must be run just after
21  /// this method.
22  /// </summary>
23  /// <param name="parameters">The parameters.</param>
24  Action PrepareForRun(TemplateGeneratorParameters parameters);
25 
26  void AfterRun(TemplateGeneratorParameters parameters);
27  }
28 
29 
30  /// <summary>
31  /// Base implementation for <see cref="ITemplateGenerator"/>.
32  /// </summary>
33  public abstract class TemplateGeneratorBase : ITemplateGenerator
34  {
35  public abstract bool IsSupportingTemplate(TemplateDescription templateDescription);
36 
37  public abstract Action PrepareForRun(TemplateGeneratorParameters parameters);
38 
39  public virtual void AfterRun(TemplateGeneratorParameters parameters)
40  {
41  }
42  }
43 }
Base implementation for ITemplateGenerator.
Parameters used by ITemplateGenerator.PrepareForRun
Description of a template generator that can be displayed in the GameStudio.
virtual void AfterRun(TemplateGeneratorParameters parameters)