Added Workshop.itemHandle

This commit is contained in:
Garry Newman 2016-10-24 15:25:02 +01:00
parent c37ea38107
commit f1dd4462f2
2 changed files with 21 additions and 0 deletions

View File

@ -50,6 +50,17 @@ internal static Item From( SteamNative.SteamUGCDetails_t details, Workshop works
return item;
}
internal static Item FromId( ulong id, Workshop workshop )
{
var item = new Item();
item.workshop = workshop;
item.Id = id;
item.UpdateState();
return item;
}
public void Download( bool highPriority = true )
{
UpdateState();

View File

@ -59,6 +59,16 @@ public Query CreateQuery()
};
}
/// <summary>
/// Returns a class representing this ItemId. We don't query
/// item name, description etc. We don't verify that item exists.
/// We don't verify that this item belongs to your app.
/// </summary>
public Item ItemHandle( ulong ItemId )
{
return Item.FromId( ItemId, this );
}
public Editor CreateItem( ItemType type )
{
return new Editor() { workshop = this, Type = type };