sockscape/server/Libraries/Square/INI/Section.cs

46 lines
1 KiB
C#
Raw Normal View History

2017-06-06 21:13:25 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Square.INI {
2017-06-07 21:02:29 +00:00
public class Section : IEnumerable<Instance> {
private List<Instance> Instances = new List<Instance>();
2017-06-06 21:13:25 +00:00
2017-06-07 21:02:29 +00:00
internal Section() { }
internal Instance Push() {
Instances.Add(new Instance());
return Instances[Instances.Count - 1];
}
public string this[string key] {
get {
return Instances[0][key];
}
}
public Instance this[int i] {
get {
return Instances[i];
}
}
public int Count {
get {
return Instances.Count;
}
}
IEnumerator IEnumerable.GetEnumerator() {
return Instances.GetEnumerator();
}
IEnumerator<Instance> IEnumerable<Instance>.GetEnumerator() {
2017-06-06 21:13:25 +00:00
return Instances.GetEnumerator();
}
}
}