mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 13:45:37 +03:00
Way for a client to manually create an ItemDefinition
playtimegenerator types aren't sent to the client
This commit is contained in:
parent
a908a9b994
commit
503e0529c0
@ -112,8 +112,6 @@ public void GetVoice()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void InventoryDefinitions()
|
||||
{
|
||||
@ -121,7 +119,12 @@ public void InventoryDefinitions()
|
||||
{
|
||||
Assert.IsNotNull( client.Inventory.Definitions );
|
||||
Assert.AreNotEqual( 0, client.Inventory.Definitions.Length );
|
||||
}
|
||||
|
||||
foreach ( var i in client.Inventory.Definitions )
|
||||
{
|
||||
Console.WriteLine( "{0}: {1}", i.Id, i.Name );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
@ -66,6 +66,14 @@ public void Refresh()
|
||||
}
|
||||
}
|
||||
|
||||
public Definition CreateDefinition( int id )
|
||||
{
|
||||
return new Definition( id )
|
||||
{
|
||||
client = client
|
||||
};
|
||||
}
|
||||
|
||||
internal void LoadItemDefinitions()
|
||||
{
|
||||
//
|
||||
@ -79,12 +87,7 @@ internal void LoadItemDefinitions()
|
||||
|
||||
Definitions = ids.Select( x =>
|
||||
{
|
||||
var d = new Definition()
|
||||
{
|
||||
client = client,
|
||||
Id = x
|
||||
};
|
||||
|
||||
var d = CreateDefinition( x );
|
||||
d.SetupCommonProperties();
|
||||
return d;
|
||||
|
||||
@ -229,6 +232,11 @@ public class Definition
|
||||
public DateTime Created;
|
||||
public DateTime Modified;
|
||||
|
||||
internal Definition( int id )
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public T GetProperty<T>( string name )
|
||||
{
|
||||
string val = string.Empty;
|
||||
|
Loading…
Reference in New Issue
Block a user