public static string ToShortString(this FigurePartType figurePartType) { return(figurePartType switch { FigurePartType.Hair => "hr", FigurePartType.Head => "hd", FigurePartType.Chest => "ch", FigurePartType.Legs => "lg", FigurePartType.Shoes => "sh", FigurePartType.Hat => "ha", FigurePartType.HeadAccessory => "he", FigurePartType.EyeAccessory => "ea", FigurePartType.FaceAccessory => "fa", FigurePartType.ChestAccessory => "ca", FigurePartType.WaistAccessory => "wa", FigurePartType.Coat => "cc", FigurePartType.ChestPrint => "cp", _ => throw new ArgumentException($"Unknown figure part type: {figurePartType}", nameof(figurePartType)), });
public FigurePart(FigurePartType type, int id) : this(type) { Id = id; }
public FigurePart(FigurePartType type) { Type = type; Colors = new List <int>(); }
public PartSetCollection GetSetCollection(FigurePartType figurePartType) => SetCollections.FirstOrDefault(x => x.Type == figurePartType) ?? throw new Exception($"No set collection found for figure part type: {figurePartType}.");
public Palette GetPalette(FigurePartType figurePartType) => GetPalette(GetSetCollection(figurePartType));