mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 06:38:01 +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 @@ namespace Facepunch.Steamworks.Test
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void InventoryDefinitions()
|
public void InventoryDefinitions()
|
||||||
{
|
{
|
||||||
@ -121,7 +119,12 @@ namespace Facepunch.Steamworks.Test
|
|||||||
{
|
{
|
||||||
Assert.IsNotNull( client.Inventory.Definitions );
|
Assert.IsNotNull( client.Inventory.Definitions );
|
||||||
Assert.AreNotEqual( 0, client.Inventory.Definitions.Length );
|
Assert.AreNotEqual( 0, client.Inventory.Definitions.Length );
|
||||||
}
|
|
||||||
|
foreach ( var i in client.Inventory.Definitions )
|
||||||
|
{
|
||||||
|
Console.WriteLine( "{0}: {1}", i.Id, i.Name );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
@ -66,6 +66,14 @@ namespace Facepunch.Steamworks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Definition CreateDefinition( int id )
|
||||||
|
{
|
||||||
|
return new Definition( id )
|
||||||
|
{
|
||||||
|
client = client
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
internal void LoadItemDefinitions()
|
internal void LoadItemDefinitions()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@ -79,12 +87,7 @@ namespace Facepunch.Steamworks
|
|||||||
|
|
||||||
Definitions = ids.Select( x =>
|
Definitions = ids.Select( x =>
|
||||||
{
|
{
|
||||||
var d = new Definition()
|
var d = CreateDefinition( x );
|
||||||
{
|
|
||||||
client = client,
|
|
||||||
Id = x
|
|
||||||
};
|
|
||||||
|
|
||||||
d.SetupCommonProperties();
|
d.SetupCommonProperties();
|
||||||
return d;
|
return d;
|
||||||
|
|
||||||
@ -229,6 +232,11 @@ namespace Facepunch.Steamworks
|
|||||||
public DateTime Created;
|
public DateTime Created;
|
||||||
public DateTime Modified;
|
public DateTime Modified;
|
||||||
|
|
||||||
|
internal Definition( int id )
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public T GetProperty<T>( string name )
|
public T GetProperty<T>( string name )
|
||||||
{
|
{
|
||||||
string val = string.Empty;
|
string val = string.Empty;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user