using System; using System.IO; using Nibriboard.RippleSpace; namespace Nibriboard.Utilities { public static class CalcPaths { /// /// Returns the directory in which a plane's data should be unpacked to. /// /// The root directory to which everything is going to be unpacked. /// The name of the plane that will be unpacked. /// The directory to which a plane should unpack it's data to. public static string PlaneDirectory(string storageRoot, string planeName) { string result = Path.Combine(storageRoot, "Planes", planeName); return result; } /// /// Returns the path to the plane index file given a directory that a plane has been unpacked to. /// /// The directory to which a plane's data has been unpacked. /// The path to the plane index file. public static string PlaneIndex(string planeDirectory) { return Path.Combine(planeDirectory, "plane-index.json"); } public static string RippleSpaceAccountData(string rippleSpaceRoot) { return Path.Combine(rippleSpaceRoot, "user-data.json"); } public static string ChunkFilePath(string planeStorageDirectory, ChunkReference chunkRef) { return Path.Combine(planeStorageDirectory, chunkRef.AsFilepath()); } } }