Removed old rememberleavepos variable and added docs.
This commit is contained in:
parent
be45fb762b
commit
896a8272c9
1 changed files with 21 additions and 5 deletions
|
|
@ -22,36 +22,52 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
public class FileTools
|
public class FileTools
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Path to the file containing the rules.
|
||||||
|
/// </summary>
|
||||||
internal static string RulesPath
|
internal static string RulesPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "rules.txt"); }
|
get { return Path.Combine(TShock.SavePath, "rules.txt"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Path to the file containing the message of the day.
|
||||||
|
/// </summary>
|
||||||
internal static string MotdPath
|
internal static string MotdPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "motd.txt"); }
|
get { return Path.Combine(TShock.SavePath, "motd.txt"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Path to the file containing the whitelist.
|
||||||
|
/// </summary>
|
||||||
internal static string WhitelistPath
|
internal static string WhitelistPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "whitelist.txt"); }
|
get { return Path.Combine(TShock.SavePath, "whitelist.txt"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string RememberedPosPath
|
/// <summary>
|
||||||
{
|
/// Path to the file containing the config.
|
||||||
get { return Path.Combine(TShock.SavePath, "oldpos.xml"); }
|
/// </summary>
|
||||||
}
|
|
||||||
|
|
||||||
internal static string ConfigPath
|
internal static string ConfigPath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(TShock.SavePath, "config.json"); }
|
get { return Path.Combine(TShock.SavePath, "config.json"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates an empty file at the given path.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file">The path to the file.</param>
|
||||||
public static void CreateFile(string file)
|
public static void CreateFile(string file)
|
||||||
{
|
{
|
||||||
File.Create(file).Close();
|
File.Create(file).Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a file if the files doesn't already exist.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file">The path to the files</param>
|
||||||
|
/// <param name="data">The data to write to the file.</param>
|
||||||
public static void CreateIfNot(string file, string data = "")
|
public static void CreateIfNot(string file, string data = "")
|
||||||
{
|
{
|
||||||
if (!File.Exists(file))
|
if (!File.Exists(file))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue