public void Deserialize(EntityPropsProp entity_props, JObject root) { entity_props.invulnerable = root["invulnerable"].GetBool(); entity_props.m_no_chunk = root["m_no_chunk"].GetBool(); entity_props.index = root["index"].GetInt(); if (root["m_hp"].IsValid()) { entity_props.m_hp = root["m_hp"].GetFloat(); } }
// PROP public void Serialize(EntityPropsProp entity_props, JObject root) { root["invulnerable"] = entity_props.invulnerable.ToString(); root["m_no_chunk"] = entity_props.m_no_chunk.ToString(); root["index"] = entity_props.index.ToString(); if (entity_props.m_hp.HasValue) { root["m_hp"] = entity_props.m_hp.ToString(); } }