using System;
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 UnpackedPlaneDir(string unpackingRoot, string planeName)
{
string result = $"{unpackingRoot}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 UnpackedPlaneIndex(string unpackingPlaneDir)
{
return $"{unpackingPlaneDir}/plane-index.json";
}
///
/// Calculates the path to a packed plane file.
///
/// The directory to which the nplane files were unpacked.
/// The name of the plane to fetch the filepath for.
/// The path to the packed plane file.
public static string UnpackedPlaneFile(string unpackingDir, string planeName)
{
return $"{unpackingDir}{planeName}.nplane.zip";
}
public static string ChunkFilepath(string planeStorageDirectory, ChunkReference chunkRef)
{
return $"{planeStorageDirectory}{chunkRef.AsFilename()}";
}
}
}