示例#1
0
 /// <summary>
 /// Determines whether this instance contains an asset with the specified identifier.
 /// </summary>
 /// <param name="assetId">The asset identifier.</param>
 /// <returns><c>true</c> if this instance contains an asset with the specified identifier; otherwise, <c>false</c>.</returns>
 public bool ContainsById(AssetId assetId)
 {
     return(mapIdToAsset.ContainsKey(assetId));
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AssetReference"/> class.
 /// </summary>
 /// <param name="id">The unique identifier of the asset.</param>
 /// <param name="location">The location.</param>
 public AssetReference(AssetId id, UFile location)
 {
     Location = location;
     Id       = id;
 }
示例#3
0
 /// <summary>
 /// Determines whether the specified packages contains an asset by its guid.
 /// </summary>
 /// <param name="packages">The packages.</param>
 /// <param name="assetId">The asset unique identifier.</param>
 /// <returns><c>true</c> if the specified packages contains asset; otherwise, <c>false</c>.</returns>
 public static bool ContainsAsset(this IEnumerable <Package> packages, AssetId assetId)
 {
     return(packages.Any(package => package.Assets.ContainsById(assetId)));
 }
示例#4
0
 public static AssetReference New(AssetId id, UFile location)
 {
     return(new AssetReference(id, location));
 }