forked from XIV-Tools/CustomizePlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomizeService.cs
More file actions
37 lines (32 loc) · 837 Bytes
/
Copy pathCustomizeService.cs
File metadata and controls
37 lines (32 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.IO;
using Anamnesis.Files;
using Anamnesis.Serialization;
namespace ConsoleApp1
{
public static class CustomizeService
{
private static Dictionary<string, PoseFile> poseFiles = new Dictionary<string, PoseFile>();
public static void LoadCustomizers()
{
string[] templates = Directory.GetFiles("Poses/", "*.pose");
foreach (string posePath in templates)
{
Load(posePath);
}
}
public static PoseFile? GetPose(string actorName)
{
if (poseFiles.ContainsKey(actorName))
return poseFiles[actorName];
return null;
}
private static void Load(string path)
{
PoseFile template = SerializerService.DeserializeFile<PoseFile>(path);
string name = Path.GetFileNameWithoutExtension(path);
poseFiles.Add(name, template);
}
}
}