/// <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)); }
/// <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; }
/// <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))); }
public static AssetReference New(AssetId id, UFile location) { return(new AssetReference(id, location)); }