private void AddLevels() { CFGReader reader = new CFGReader(Encoding.ASCII.GetString(mPakCollection.GetRecord("levels\\stages.cfg").Buffer)); CFGBlock[] stages = reader.Document.Blocks[0].GetBlocks("stage"); foreach (CFGBlock block in stages) { foreach (CFGProperty property in block) { if (property.Name.ToLower() == "level") { AddLevel(property[0], property[1], Convert.ToInt32(property[2])); } } } }
private void AddValues(string str) { int start_index = 0; int end_index = -1; int index = -1; do { index = CFGReader.SpecialIndexOf(str, ',', start_index); if (index == -1) { end_index = str.Length; } else { end_index = index; } string v = str.Substring(start_index, end_index - start_index); mValues.Add(CFGReader.Dequote(v.Trim())); start_index = end_index + 1; } while (index != -1); }
public static CFGDocument Read(string cfg) { CFGReader reader = new CFGReader(cfg); return(reader.Document); }