2018-12-23 17:04:11 +00:00
|
|
|
|
using Microsoft.Xna.Framework.Content;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace RecrownedAthenaeum.Pipeline
|
|
|
|
|
{
|
2019-01-15 23:33:55 +00:00
|
|
|
|
class NinePatchDataReader : ContentTypeReader<SpecialTypes.NinePatch>
|
2018-12-23 17:04:11 +00:00
|
|
|
|
{
|
2019-01-15 23:33:55 +00:00
|
|
|
|
protected override SpecialTypes.NinePatch Read(ContentReader input, SpecialTypes.NinePatch existingInstance)
|
2018-12-23 17:04:11 +00:00
|
|
|
|
{
|
|
|
|
|
int length = input.ReadInt32();
|
|
|
|
|
byte[] bytes = input.ReadBytes(length);
|
|
|
|
|
|
2019-01-15 23:33:55 +00:00
|
|
|
|
return JsonConvert.DeserializeObject<SpecialTypes.NinePatch>(Encoding.UTF8.GetString(bytes));
|
2018-12-23 17:04:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|