Lots of data and model setup

This commit is contained in:
gamer147
2025-05-18 02:27:17 -04:00
parent 79505e0c1a
commit b2024af852
77 changed files with 81988 additions and 433 deletions

View File

@@ -1,4 +1,5 @@
using MessagePack;
using SVSim.Database.Models;
namespace SVSim.EmulatedEntrypoint.Models.Dtos;
@@ -17,9 +18,9 @@ public class UserDeck
[Key("leader_skin_id")]
public int LeaderSkinId { get; set; }
[Key("deck_name")]
public string DeckName { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
[Key("card_id_array")]
public List<int> Cards { get; set; } = new List<int>();
public List<long> Cards { get; set; } = new List<long>();
[Key("is_complete_deck")]
public int IsCompleteDeck { get; set; }
[Key("restricted_card_exists")]
@@ -27,7 +28,7 @@ public class UserDeck
[Key("is_available_deck")]
public int IsAvailable { get; set; }
[Key("maintenance_card_ids")]
public List<int> MaintenanceCards { get; set; } = new List<int>();
public List<long> MaintenanceCards { get; set; } = new List<long>();
[Key("is_include_un_possession_card")]
public bool IncludesNonCollectibleCards { get; set; }
[Key("is_random_leader_skin")]
@@ -38,4 +39,30 @@ public class UserDeck
public int Order { get; set; }
[Key("create_deck_time")]
public DateTime DeckCreateTime { get; set; }
public UserDeck(ShadowverseDeckEntry deck)
{
this.DeckNumber = deck.Number;
this.ClassId = deck.Class.Id;
this.LeaderSkinId = deck.LeaderSkin.Id;
this.SleeveId = deck.Sleeve.Id;
this.Name = deck.Name;
this.Cards = deck.Cards.SelectMany(card => Enumerable.Range(0, card.Count).Select(count => card.Card.Id))
.ToList();
this.IsRandomLeaderSkin = deck.RandomLeaderSkin ? 1 : 0;
this.Order = deck.Number;
this.DeckCreateTime = deck.DateCreated;
//TODO probably want to calc some of these on demand
this.IsCompleteDeck = 1;
this.RestrictedCardExists = false;
this.IsAvailable = 1;
this.MaintenanceCards = new();
this.IncludesNonCollectibleCards = false;
}
public UserDeck()
{
}
}