private void PrepareData()
{
var json = File.ReadAllText(@"..\..\CardTable.json");
_json = json;
var cardTable = new TemplateTable<string, CardDescription>();
cardTable.Load(new TemplateTableJsonLoader<string, CardDescription>(json, true));
// Save BsonPack
using (var file = File.Create("CardTableBsonPack.bin"))
{
new TemplateTableBsonPackSaver<string, CardDescription>().SaveTo(cardTable, file);
}
_bsonPack = File.ReadAllBytes("CardTableBsonPack.bin");
// Save ProtobufPack
using (var file = File.Create("CardTableProtobufPack.bin"))
{
new TemplateTableProtobufPackSaver<string, CardDescription>().SaveTo(cardTable, file);
}
_protobufPack = File.ReadAllBytes("CardTableProtobufPack.bin");
}