Saving to DB, need to render

This commit is contained in:
Lani Aung
2021-11-02 18:33:07 -06:00
parent d52cc4b206
commit 16dfc040a4
18 changed files with 318 additions and 212 deletions
+12 -2
View File
@@ -1,10 +1,20 @@
using Dapper.Contrib.Extensions;
using System.ComponentModel.DataAnnotations.Schema;
namespace fxl.codes.kisekae.Entities
{
[Table("cel_config")]
public class CelConfigDto
{
public int Id { get; set; }
[Column("cel_id")] public int CelId { get; set; }
[Column("config_id")] public int ConfigId { get; set; }
public int Group { get; set; }
public int Fix { get; set; }
public Set Sets { get; set; } = Set.Unset;
public int Transparency { get; set; }
public string Comment { get; set; }
[Column("palette_id")] public int PaletteId { get; set; }
public int X { get; set; }
public int Y { get; set; }
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
using Dapper.Contrib.Extensions;
using System.ComponentModel.DataAnnotations.Schema;
namespace fxl.codes.kisekae.Entities
{
@@ -6,7 +6,7 @@ namespace fxl.codes.kisekae.Entities
public class CelDto : IKisekaeFile, IKisekaeParseable
{
public int Id { get; set; }
public int KisekaeId { get; set; }
[Column("kisekae_id")] public int KisekaeId { get; set; }
public string Filename { get; set; }
public byte[] Data { get; set; }
}
+7 -6
View File
@@ -1,18 +1,19 @@
using System.Collections.Generic;
using Dapper.Contrib.Extensions;
using System.ComponentModel.DataAnnotations.Schema;
namespace fxl.codes.kisekae.Entities
{
[Table("configuration")]
public class ConfigurationDto : IKisekaeFile
{
public int Id { get; set; }
public int KisekaeId { get; set; }
public string Filename { get; set; }
public string Data { get; set; }
public int? Height { get; set; }
public int? Width { get; set; }
public int? BorderIndex { get; set; }
public IEnumerable<CelConfigDto> Cels { get; set; }
[Column("border_index")] public int? BorderIndex { get; set; }
public List<CelConfigDto> Cels { get; set; } = new();
public List<PaletteDto> Palettes { get; set; } = new();
public int Id { get; set; }
[Column("kisekae_id")] public int KisekaeId { get; set; }
public string Filename { get; set; }
}
}
+3 -3
View File
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using Dapper.Contrib.Extensions;
using System.ComponentModel.DataAnnotations.Schema;
namespace fxl.codes.kisekae.Entities
{
@@ -7,8 +7,8 @@ namespace fxl.codes.kisekae.Entities
public class KisekaeDto
{
public int Id { get; set; }
public string Name { get; set; }
public string Filename { get; set; }
public string Name { get; init; }
public string Filename { get; init; }
public string Checksum { get; set; }
public IEnumerable<ConfigurationDto> Configurations { get; set; }
}
+13
View File
@@ -0,0 +1,13 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace fxl.codes.kisekae.Entities
{
[Table("palette_color")]
public class PaletteColorDto
{
public int Id { get; set; }
[Column("palette_id")] public int PaletteId { get; set; }
public int Group { get; set; }
public string Hex { get; set; }
}
}
+4 -4
View File
@@ -1,14 +1,14 @@
using Dapper.Contrib.Extensions;
using System.ComponentModel.DataAnnotations.Schema;
namespace fxl.codes.kisekae.Entities
{
[Table("palette")]
public class PaletteDto : IKisekaeFile, IKisekaeParseable
{
public int Id { get; set; }
public int KisekaeId { get; set; }
public string Filename { get; set; }
public string Comment { get; set; }
public int Id { get; set; }
[Column("kisekae_id")] public int KisekaeId { get; set; }
public string Filename { get; set; }
public byte[] Data { get; set; }
}
}
+1
View File
@@ -5,6 +5,7 @@ namespace fxl.codes.kisekae.Entities
[Flags]
public enum Set
{
Unset = -1,
Zero = 2 ^ 0,
One = 2 ^ 1,
Two = 2 ^ 2,