This commit is contained in:
yawaflua
2024-04-18 18:38:00 +03:00
parent 2a1317d393
commit 2df80a4c4b
14 changed files with 324 additions and 83 deletions

22
Deserialize.cs Normal file
View File

@@ -0,0 +1,22 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace spworlds
{
internal class Deserialize
{
public static T DeserializeObject<T>(string data) where T : class
{
T objectToReturn = JsonConvert.DeserializeObject<T>(data);
if (objectToReturn == null)
throw new Exception("User not player.");
else
return objectToReturn;
}
}
}