Thinking about shunting most of the file parsing into db services since it should be done once

This commit is contained in:
Lani Aung
2021-10-27 07:58:18 -06:00
parent 804ccd0eeb
commit d52cc4b206
16 changed files with 271 additions and 113 deletions
+21
View File
@@ -0,0 +1,21 @@
using System.Collections.Generic;
using fxl.codes.kisekae.Entities;
namespace fxl.codes.kisekae.Models
{
public class ConfigurationModel
{
public ConfigurationModel(KisekaeDto dto)
{
Id = dto.Id;
Name = dto.Name;
Configurations = new Dictionary<int, string>();
foreach (var config in dto.Configurations) Configurations.Add(config.Id, config.Filename);
}
public int Id { get; }
public string Name { get; }
public IDictionary<int, string> Configurations { get; }
}
}
-26
View File
@@ -1,26 +0,0 @@
using System.Collections.Generic;
namespace fxl.codes.kisekae.Models
{
public class DirectoryModel
{
public string Name { get; }
public DirectoryModel(string name)
{
Name = name;
}
public List<ConfigurationModel> Configurations { get; } = new();
}
public class ConfigurationModel
{
public string Name { get; }
public ConfigurationModel(string name)
{
Name = name;
}
}
}
+1
View File
@@ -10,6 +10,7 @@ namespace fxl.codes.kisekae.Models
public string Name { get; set; }
public int Height { get; set; }
public int Width { get; set; }
[JsonIgnore] public int BorderColorIndex { get; set; }
[JsonIgnore] public Color BorderColor { get; set; } = Color.Black;
[JsonIgnore] public List<PaletteModel> Palettes { get; } = new();
public List<CelModel> Cels { get; } = new();