feat: Adding methods to get the data directory for a given room

This commit is contained in:
Chris Cameron
2019-11-06 14:34:47 -05:00
parent 09e0a20443
commit 13a2493f4c

View File

@@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using ICD.Common.Properties; using ICD.Common.Properties;
using ICD.Common.Utils.Extensions; using ICD.Common.Utils.Extensions;
@@ -289,6 +288,27 @@ namespace ICD.Common.Utils
return Join(ProgramDataPath, local); return Join(ProgramDataPath, local);
} }
/// <summary>
///Appends the local path to the room data path.
/// </summary>
/// <returns></returns>
public static string GetRoomDataPath(int roomId, params string[] localPath)
{
string local = Join(localPath);
string roomDataDirectory = GetRoomDataDirectory(roomId);
return Join(ProgramDataPath, roomDataDirectory, local);
}
/// <summary>
/// Gets the directory name of the room data directory for the room with the given id.
/// </summary>
/// <param name="roomId"></param>
/// <returns></returns>
public static string GetRoomDataDirectory(int roomId)
{
return string.Format("Room{0}Data", roomId);
}
/// <summary> /// <summary>
/// Returns true if the given path exists. /// Returns true if the given path exists.
/// </summary> /// </summary>