public static void saveGroups(List<Group> givenList)
{
StreamWriter SW = new StreamWriter(File.Create("properties/ranks.properties"));
SW.WriteLine("#RankName = string");
SW.WriteLine("# The name of the rank, use capitalization.");
SW.WriteLine("#");
SW.WriteLine("#Permission = num");
SW.WriteLine("# The \"permission\" of the rank. It's a number.");
SW.WriteLine("# There are pre-defined permissions already set. (for the old ranks)");
SW.WriteLine("# Banned = -20, Guest = 0, Builder = 30, AdvBuilder = 50, Operator = 80");
SW.WriteLine("# SuperOP = 100, Nobody = 120");
SW.WriteLine("# Must be greater than -50 and less than 120");
SW.WriteLine("# The higher the number, the more commands do (such as undo allowing more seconds)");
SW.WriteLine("#Limit = num");
SW.WriteLine("# The command limit for the rank (can be changed in-game with /limit)");
SW.WriteLine("# Must be greater than 0 and less than 10000000");
SW.WriteLine("#Color = char");
SW.WriteLine("# A single letter or number denoting the color of the rank");
SW.WriteLine("# Possibilities:");
SW.WriteLine("# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f");
SW.WriteLine("#FileName = string.txt");
SW.WriteLine("# The file which players of this rank will be stored in");
SW.WriteLine("# It doesn't need to be a .txt file, but you may as well");
SW.WriteLine("# Generally a good idea to just use the same file name as the rank name");
SW.WriteLine();
SW.WriteLine();
foreach (Group grp in givenList)
{
if (grp.name != "nobody")
{
SW.WriteLine("RankName = " + grp.trueName);
SW.WriteLine("Permission = " + (int)grp.Permission);
SW.WriteLine("Limit = " + grp.maxBlocks);
SW.WriteLine("Color = " + grp.color[1]);
SW.WriteLine("FileName = " + grp.fileName);
SW.WriteLine();
}
}
SW.Flush();
SW.Close();
}