Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
TemplateDescription.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 using System.Collections.Generic;
5 using System.ComponentModel;
6 using System.Diagnostics;
7 using SiliconStudio.Core;
8 using SiliconStudio.Core.IO;
9 
10 namespace SiliconStudio.Assets.Templates
11 {
12  /// <summary>
13  /// Description of a template generator that can be displayed in the GameStudio.
14  /// </summary>
15  [DataContract("Template")]
16  [DebuggerDisplay("Id: {Id}, Name: {Name}")]
18  {
19  /// <summary>
20  /// The file extension used when loading/saving this template description.
21  /// </summary>
22  public const string FileExtension = ".pdxtpl";
23 
24  /// <summary>
25  /// Initializes a new instance of the <see cref="TemplateDescription"/> class.
26  /// </summary>
28  {
29  Screenshots = new List<UFile>();
30  }
31 
32  /// <summary>
33  /// Gets or sets the unique identifier.
34  /// </summary>
35  /// <value>The identifier.</value>
36  [DataMember(0)]
37  public Guid Id { get; set; }
38 
39  /// <summary>
40  /// Gets or sets the short name of this template
41  /// </summary>
42  /// <value>The name.</value>
43  [DataMember(10)]
44  public string Name { get; set; }
45 
46  /// <summary>
47  /// Gets or sets the scope of this template.
48  /// </summary>
49  /// <value>The context.</value>
50  [DataMember(15)]
51  [DefaultValue(TemplateScope.Session)]
52  public TemplateScope Scope { get; set; }
53 
54  /// <summary>
55  /// Gets or sets the order (lower value means higher order)
56  /// </summary>
57  /// <value>The order.</value>
58  [DataMember(17)]
59  [DefaultValue(0)]
60  public int Order { get; set; }
61 
62  /// <summary>
63  /// Gets or sets the group.
64  /// </summary>
65  /// <value>The group.</value>
66  [DataMember(20)]
67  [DefaultValue(null)]
68  public string Group { get; set; }
69 
70  /// <summary>
71  /// Gets or sets the icon/bitmap.
72  /// </summary>
73  /// <value>The icon.</value>
74  [DataMember(30)]
75  [DefaultValue(null)]
76  public UFile Icon { get; set; }
77 
78  /// <summary>
79  /// Gets the screenshots.
80  /// </summary>
81  /// <value>The screenshots.</value>
82  [DataMember(30)]
83  public List<UFile> Screenshots { get; private set; }
84 
85  /// <summary>
86  /// Gets or sets the description.
87  /// </summary>
88  /// <value>The description.</value>
89  [DataMember(40)]
90  [DefaultValue(null)]
91  public string Description { get; set; }
92 
93  /// <summary>
94  /// Gets or sets a longer description.
95  /// </summary>
96  /// <value>The longer description.</value>
97  [DataMember(43)]
98  [DefaultValue(null)]
99  public string FullDescription { get; set; }
100 
101  /// <summary>
102  /// Gets or set the default name for the output package/library.
103  /// </summary>
104  /// <value>The default output name.</value>
105  [DataMember(45)]
106  public string DefaultOutputName { get; set; }
107 
108  /// <summary>
109  /// Gets or sets the status.
110  /// </summary>
111  /// <value>The status.</value>
112  [DataMember(60)]
113  [DefaultValue(TemplateStatus.None)]
114  public TemplateStatus Status { get; set; }
115 
116  /// <inheritdoc/>
117  [DataMemberIgnore]
118  public bool IsDirty { get; set; }
119 
120  /// <inheritdoc/>
121  [DataMemberIgnore]
122  public UFile FullPath { get; set; }
123 
124  /// <summary>
125  /// Gets the directory from where this template was loaded
126  /// </summary>
127  /// <value>The resource directory.</value>
128  [DataMemberIgnore]
129  public UDirectory TemplateDirectory
130  {
131  get
132  {
133  return FullPath != null ? FullPath.GetParent() : null;
134  }
135  }
136  }
137 }
TemplateScope
Describes if a template is supporting a particular context
TemplateDescription()
Initializes a new instance of the TemplateDescription class.
Description of a template generator that can be displayed in the GameStudio.
Defines a normalized directory path. See UPath for details. This class cannot be inherited.
Definition: UDirectory.cs:13
Identify an object that is associated with an anchor file on the disk where all the UPath members of ...
TemplateStatus
Status of the template
Defines a normalized file path. See UPath for details. This class cannot be inherited.
Definition: UFile.cs:13