Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
AssetToImportMergeGroup.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.Diagnostics;
6 using SiliconStudio.Assets.Diff;
7 using SiliconStudio.Core.Diagnostics;
8 
9 namespace SiliconStudio.Assets
10 {
11  /// <summary>
12  /// Describes an asset to import associated with possible existing assets, mergeable or not.
13  /// </summary>
14  [DebuggerDisplay("Item: {Item} Merges: [{Merges.Count}]")]
16  {
18  {
19  if (parent == null) throw new ArgumentNullException("parent");
20  if (item == null) throw new ArgumentNullException("item");
21  this.Parent = parent;
22  Item = item;
23  Merges = new List<AssetToImportMerge>();
24  Enabled = true;
25  var assetDescription = AssetRegistry.GetDescription(item.Asset.GetType());
26  Log = new LoggerResult(string.Format("Import {0} {1}", assetDescription != null ? assetDescription.DisplayName : "Asset" , item));
27  }
28 
29  /// <summary>
30  /// Gets the parent.
31  /// </summary>
32  /// <value>The parent.</value>
33  public AssetToImportByImporter Parent { get; private set; }
34 
35  /// <summary>
36  /// Gets the item to import.
37  /// </summary>
38  /// <value>The item.</value>
39  public AssetItem Item { get; private set; }
40 
41  /// <summary>
42  /// Gets a list of equivalent assets that could be merged into.
43  /// </summary>
44  /// <value>The merges.</value>
45  public List<AssetToImportMerge> Merges { get; private set; }
46 
47  /// <summary>
48  /// Gets or sets the selected item. If this value is set
49  /// </summary>
50  /// <value>The selected item.</value>
51  public AssetItem SelectedItem { get; set; }
52 
53  /// <summary>
54  /// Gets or sets the final item to import.
55  /// </summary>
56  /// <value>The final item.</value>
57  public AssetItem MergedItem { get; internal set; }
58 
59  /// <summary>
60  /// Gets a value indicating whether the <see cref="MergedItem"/> is a merged item.
61  /// </summary>
62  /// <value><c>true</c> if this instance is merged; otherwise, <c>false</c>.</value>
63  public bool IsMerged
64  {
65  get
66  {
67  return MergedResult != null;
68  }
69  }
70 
71  /// <summary>
72  /// Gets or sets a value indicating whether this <see cref="AssetToImportMergeGroup"/> is enabled.
73  /// </summary>
74  /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value>
75  public bool Enabled { get; set; }
76 
77  /// <summary>
78  /// Gets the log.
79  /// </summary>
80  /// <value>The log.</value>
81  public LoggerResult Log { get; private set; }
82 
83  /// <summary>
84  /// Gets a value indicating whether this instance has errors.
85  /// </summary>
86  /// <value><c>true</c> if this instance has errors; otherwise, <c>false</c>.</value>
87  public bool HasErrors
88  {
89  get
90  {
91  return Log.HasErrors;
92  }
93  }
94 
95  /// <summary>
96  /// Gets the merge result.
97  /// </summary>
98  /// <value>The merge result.</value>
99  public MergeResult MergedResult { get; internal set; }
100  }
101 }
Result of a merge. Contains Asset != null if there are no errors.
Definition: MergeResult.cs:10
SiliconStudio.Core.Diagnostics.LoggerResult LoggerResult
A logger that stores messages locally useful for internal log scenarios.
Definition: LoggerResult.cs:14
An asset item part of a Package accessible through SiliconStudio.Assets.Package.Assets.
Definition: AssetItem.cs:17
Describes an asset to import associated with possible existing assets, mergeable or not...
Describes the importer that will import an AssetToImport and the generated list of assets to import...
Output message to log right away.