public BSPEntity(String EntityString) { //Parse bool IsArgument = true; ArgValue CurrentArgValue = new ArgValue(); int StartQuotePos = EntityString.IndexOf("\""); while (StartQuotePos > -1) { int EndQuotePos = EntityString.IndexOf("\"", StartQuotePos + 1); if (EndQuotePos > -1) { String InnerText = EntityString.Substring(StartQuotePos + 1, EndQuotePos - StartQuotePos - 1); if (IsArgument) { CurrentArgValue = new ArgValue(); CurrentArgValue.Argument = InnerText; IsArgument = false; } else { CurrentArgValue.Value = InnerText; AddArgValue(CurrentArgValue); IsArgument = true; } StartQuotePos = EntityString.IndexOf("\"", EndQuotePos + 1); } else { StartQuotePos = -1; } } }
public void AddArgValue(ArgValue NewArgValue) { ArgValues.Add(NewArgValue); }