Way for a client to manually create an ItemDefinition

playtimegenerator types aren't sent to the client
This commit is contained in:
Garry Newman 2016-09-28 15:13:31 +01:00
parent a908a9b994
commit 503e0529c0
2 changed files with 20 additions and 9 deletions

View File

@ -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]

View File

@ -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;