private static void Parse(String str, GameObjects result) { String[] pair = str.Split(new[] { "::" }, StringSplitOptions.None); if (pair.Length == 1) { result.AddObject(pair[0].Trim()); } else if (pair.Length == 2) { result.AddScript(pair[0].Trim(), pair[1].Trim()); } else { throw new NotSupportedException($"Cannot parse the invalid symbol: {str}"); } }