/// <summary> /// Converts an Entity to a serializable string, aka /// a fully qualified type as you would see it in source code. /// </summary> /// <param name="entity">The entity.</param> /// <param name="controller">The controller where the entity is stored.</param> /// <returns>The serializable string.</returns> public static string ToSerialString(this Entity entity, CoreControl.Controller controller) { var type = controller.GetEntityType(entity.Id); if (type == ENTITY.ENUM_TYPE) { var ret = ""; ret += $"enum {entity.Name} {{"; foreach (var v in controller.GetEnumerationValues(entity.Id)) { ret += $"{v} = {controller.GetEnumerationValue(entity.Id, v)},"; } ret += "}"; return(ret); } //var t = controller.GetVariableType(entity.Id); var value = controller.GetVariableValue(entity.Id); return($"{value.GetType()} {entity.Name}"); }