4 using SiliconStudio.Assets;
5 using SiliconStudio.Assets.Templates;
6 using SiliconStudio.Core.IO;
7 using SiliconStudio.Paradox.Assets;
9 namespace SiliconStudio.
Paradox.ProjectGenerator
18 public static readonly Guid TemplateId =
new Guid(
"3c4ac35f-4d63-462e-9696-974ebaa9a862");
22 if (templateDescription == null)
throw new ArgumentNullException(
"templateDescription");
23 return templateDescription.Id == TemplateId;
28 if (parameters == null)
throw new ArgumentNullException(
"parameters");
29 parameters.Validate();
31 return () => Generate(parameters);
36 if (parameters == null)
throw new ArgumentNullException(
"parameters");
37 parameters.Validate();
39 var name = parameters.Name;
40 var outputDirectory = parameters.OutputDirectory;
43 var
package = NewPackage(name);
46 package.Meta.RootNamespace = parameters.Namespace;
52 parameters.Package = package;
55 var session = parameters.Session;
56 session.Packages.Add(package);
59 session.LoadMissingReferences(parameters.Logger);
69 var
package = new Package
74 Version = new PackageVersion("1.0.0.0")
79 package.Meta.Dependencies.Add(ParadoxConfig.GetLatestPackageDependency());
82 package.Profiles.Add(PackageProfile.NewShared());
Base implementation for ITemplateGenerator.
Parameters used by ITemplateGenerator.PrepareForRun
Description of a template generator that can be displayed in the GameStudio.
const string PackageFileExtension
The file extension used for Package.
override Action PrepareForRun(TemplateGeneratorParameters parameters)
Prepares this generator with the specified parameters and return a runnable action that must be run j...
override bool IsSupportingTemplate(TemplateDescription templateDescription)
Determines whether this generator is supporting the specified template
void Generate(TemplateGeneratorParameters parameters)
static Package NewPackage(string name)
Creates a new Paradox package with the specified name
A package managing assets.
Defines a normalized file path. See UPath for details. This class cannot be inherited.