2017-07-18 19:43:34 +00:00
|
|
|
|
using System;
|
2017-12-26 22:26:44 +00:00
|
|
|
|
using System.IO;
|
2017-07-20 19:02:50 +00:00
|
|
|
|
using Nibriboard.RippleSpace;
|
2017-07-18 19:43:34 +00:00
|
|
|
|
|
|
|
|
|
namespace Nibriboard.Utilities
|
|
|
|
|
{
|
|
|
|
|
public static class CalcPaths
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns the directory in which a plane's data should be unpacked to.
|
|
|
|
|
/// </summary>
|
2017-12-26 22:26:44 +00:00
|
|
|
|
/// <param name="storageRoot">The root directory to which everything is going to be unpacked.</param>
|
2017-07-18 19:43:34 +00:00
|
|
|
|
/// <param name="planeName">The name of the plane that will be unpacked.</param>
|
|
|
|
|
/// <returns>The directory to which a plane should unpack it's data to.</returns>
|
2017-12-26 22:26:44 +00:00
|
|
|
|
public static string PlaneDirectory(string storageRoot, string planeName)
|
2017-07-18 19:43:34 +00:00
|
|
|
|
{
|
2017-12-26 22:26:44 +00:00
|
|
|
|
string result = Path.Combine(storageRoot, "Planes", planeName);
|
2017-07-18 19:43:34 +00:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns the path to the plane index file given a directory that a plane has been unpacked to.
|
|
|
|
|
/// </summary>
|
2017-12-26 22:26:44 +00:00
|
|
|
|
/// <param name="planeDirectory">The directory to which a plane's data has been unpacked.</param>
|
2017-07-18 19:43:34 +00:00
|
|
|
|
/// <returns>The path to the plane index file.</returns>
|
2017-12-26 22:26:44 +00:00
|
|
|
|
public static string PlaneIndex(string planeDirectory)
|
2017-07-18 19:43:34 +00:00
|
|
|
|
{
|
2017-12-26 22:26:44 +00:00
|
|
|
|
return Path.Combine(planeDirectory, "plane-index.json");
|
2017-07-20 19:02:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-30 12:31:00 +00:00
|
|
|
|
public static string RippleSpaceAccountData(string rippleSpaceRoot)
|
|
|
|
|
{
|
|
|
|
|
return Path.Combine(rippleSpaceRoot, "user-data.json");
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-20 19:02:50 +00:00
|
|
|
|
|
2017-12-30 12:31:00 +00:00
|
|
|
|
public static string ChunkFilePath(string planeStorageDirectory, ChunkReference chunkRef)
|
2017-07-20 19:02:50 +00:00
|
|
|
|
{
|
2017-12-26 22:26:44 +00:00
|
|
|
|
return Path.Combine(planeStorageDirectory, chunkRef.AsFilepath());
|
2017-07-18 19:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|