mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-01 01:38:39 +00:00
parent
eb0d91914c
commit
616649e96a
2 changed files with 5 additions and 1 deletions
|
@ -78,6 +78,8 @@ namespace LBPUnion.ProjectLighthouse.Helpers
|
|||
|
||||
public static bool ResourceExists(string hash) => File.Exists(GetResourcePath(hash));
|
||||
|
||||
public static int ResourceSize(string hash) => (int)new FileInfo(GetResourcePath(hash)).Length;
|
||||
|
||||
public static void EnsureDirectoryCreated(string path)
|
||||
{
|
||||
if (!Directory.Exists(path)) Directory.CreateDirectory(path ?? throw new ArgumentNullException(nameof(path)));
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
|
|||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Types.Profiles;
|
||||
|
||||
|
@ -195,7 +196,8 @@ namespace LBPUnion.ProjectLighthouse.Types.Levels
|
|||
|
||||
public string SerializeResources()
|
||||
{
|
||||
return this.Resources.Aggregate("", (current, resource) => current + LbpSerializer.StringElement("resource", resource));
|
||||
return this.Resources.Aggregate("", (current, resource) => current + LbpSerializer.StringElement("resource", resource)) +
|
||||
LbpSerializer.StringElement("sizeOfResources", this.Resources.Sum(FileHelper.ResourceSize));
|
||||
}
|
||||
|
||||
public string Serialize(RatedLevel? yourRatingStats = null, VisitedLevel? yourVisitedStats = null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue