using CustomizePlus.Configuration.Data.Version3; using CustomizePlus.Core.Data; using CustomizePlus.Game.Services; using CustomizePlus.GameData.Extensions; using CustomizePlus.Profiles.Data; using CustomizePlus.Templates.Data; using Penumbra.GameData.Enums; using Penumbra.GameData.Structs; using System; using System.Collections.Generic; using System.Linq; using System.Numerics; using System.Text; using System.Threading.Tasks; namespace CustomizePlus.Api.Data; /// /// Bare essentials version of character profile /// public class IPCCharacterProfile { public Dictionary Bones { get; init; } = new(); public static IPCCharacterProfile FromFullProfile(Profile profile) { var ipcProfile = new IPCCharacterProfile(); foreach (var template in profile.Templates) { foreach (var kvPair in template.Bones) //not super optimal but whatever { ipcProfile.Bones[kvPair.Key] = new IPCBoneTransform { Translation = kvPair.Value.Translation, Rotation = kvPair.Value.Rotation, Scaling = kvPair.Value.Scaling }; } } return ipcProfile; } public static (Profile, Template) ToFullProfile(IPCCharacterProfile profile, bool isTemporary = true) { var fullProfile = new Profile { //Character should be set manually CreationDate = DateTimeOffset.UtcNow, ModifiedDate = DateTimeOffset.UtcNow, Enabled = true, UniqueId = Guid.NewGuid(), Templates = new List