public void ApplyJson(JToken json) { if (json["n"] == null) { return; } Name = json["n"].Value <string>(); Level = json["l"].Value <int>(); Class = json["c"].Value <string>(); Gender = json["g"].Value <int>() == 3 ? WoWGender.Female : WoWGender.Male; if (json["r"] != null) { Race = GeneralHelpers.ParseEnum <WoWRace>(json["r"].Value <string>()); } if (json["s"] != null) { Specialization.ApplyJson(json["s"]); } }