convert from csharp to typescript

public class Card
{
	public string name;

	public int id;

	public string question;

	public string override_yes = string.Empty;

	public string override_no = string.Empty;

	public string answer_yes = string.Empty;

	public string answer_no = string.Empty;

	public Bearers bearer;

	public string bearerVariation = string.Empty;

	public List<Condition> conditions = new List<Condition>();

	public float weight;

	public int lockturn;

	public int nextturn;

	public bool isLocked;

	public List<Outcome> yes_outcomes = new List<Outcome>();

	public List<Outcome> no_outcomes = new List<Outcome>();


	public Card()
	{
	}

	public Card(string[] rawele, string[] columns, char dele, Dictionary<string, string[]> i18n)
	{
		string[] array = new string[5];
		bool flag = false;
		for (int i = 0; i < columns.Length; i++)
		{
			string text = rawele[i];
			string text2 = columns[i];
			bool flag2 = false;
			if (text2.Length > 3)
			{
				if (text2.Substring(0, 4) == "yes_")
				{
					flag2 = true;
					text2 = text2.Substring(4);
				}
				else if (text2.Substring(0, 3) == "no_")
				{
					text2 = text2.Substring(3);
				}
			}
			if (text2 != null)
			{
				if (<>f__switch$map7 == null)
				{
					<>f__switch$map7 = new Dictionary<string, int>(13)
					{
						{ "id", 0 },
						{ "card", 1 },
						{ "bearer", 2 },
						{ "conditions", 3 },
						{ "lockturn", 4 },
						{ "weight", 5 },
						{ "question", 6 },
						{ "override_yes", 7 },
						{ "override_no", 8 },
						{ "answer_yes", 9 },
						{ "answer_no", 10 },
						{ "custom", 11 },
						{ "thematic", 12 }
					};
				}
				if (<>f__switch$map7.TryGetValue(text2, out var value))
				{
					switch (value)
					{
					case 0:
						if (i18n.Count > 0 && i18n.ContainsKey(text))
						{
							array = i18n[text];
							flag = true;
						}
						int.TryParse(text, out id);
						continue;
					case 1:
						if (text == "_")
						{
							text = "_" + id;
						}
						if (string.IsNullOrEmpty(text))
						{
							text = id.ToString();
						}
						name = text;
						continue;
					case 2:
						if (text.Contains(">"))
						{
							string[] array2 = text.Split(new string[1] { ">" }, StringSplitOptions.RemoveEmptyEntries);
							text = array2[0];
							bearerVariation = array2[1];
						}
						bearer = (Bearers)Enum.Parse(typeof(Bearers), text);
						if (bearer == Bearers.end)
						{
							GameAct.diff.AddEndCard(bearerVariation);
						}
						continue;
					case 3:
						conditions = Condition.TreatCondition(text);
						continue;
					case 4:
						if (text == "del")
						{
							lockturn = -1;
						}
						else if (text == "reign")
						{
							lockturn = -10;
						}
						else
						{
							int.TryParse(text, out lockturn);
						}
						nextturn = 0;
						continue;
					case 5:
						if (text == "max")
						{
							weight = -1f;
						}
						else
						{
							float.TryParse(text, out weight);
						}
						continue;
					case 6:
						question = ((!flag) ? TreatText(text) : TreatText(array[0]));
						continue;
					case 7:
						override_yes = ((!flag) ? TreatText(text) : TreatText(array[1]));
						continue;
					case 8:
						override_no = ((!flag) ? TreatText(text) : TreatText(array[2]));
						continue;
					case 9:
						answer_yes = ((!flag) ? TreatText(text) : TreatText(array[3]));
						continue;
					case 10:
						answer_no = ((!flag) ? TreatText(text) : TreatText(array[4]));
						continue;
					case 11:
						if (flag2)
						{
							yes_outcomes.AddRange(Outcome.TreatOutcome(text));
						}
						else
						{
							no_outcomes.AddRange(Outcome.TreatOutcome(text));
						}
						continue;
					case 12:
						continue;
					}
				}
			}
			if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2) && !text2.Contains("vide"))
			{
				if (flag2)
				{
					yes_outcomes.Add(new Outcome(text2, text));
				}
				else
				{
					no_outcomes.Add(new Outcome(text2, text));
				}
			}
		}
	}

	public string TreatText(string val)
	{
		val = val.Replace("<*", "<color=#e2081e>");
		val = val.Replace("*>", "</color>");
		if ((bool)SpeechAct.diff && SpeechAct.diff.asiaLayout)
		{
			val = val.Replace("+", "\n");
		}
		return val;
	}
}