JD2022-TU1/main/tools/apps/TeaBox/Script/Data/Bosses/SimpleModel.cs

39 lines
No EOL
935 B
C#

using System.Drawing;
using JD.Asset.Types.Boss;
using JD.Core.Drawing;
namespace TeaBox.Data.Bosses
{
public class SimpleModel
{
public Image Image { get; set; }
public string Name { get; set; }
public string RelatedTo { get; set; }
public SimpleModel(Boss boss)
{
if (File.Exists(boss.NewsfeedImagePath))
{
Image = Image.FromFile(boss.NewsfeedImagePath);
}
this.Name = boss.Name;
this.RelatedTo = boss.FamilyName;
}
public SimpleModel(BossFamily family)
{
if (File.Exists(family.LogoPath))
{
Image = Image.FromFile(family.LogoPath);
}
this.Name = family.Name;
this.RelatedTo = string.Join(", ", family.BossNames);
}
public override string ToString() => Name;
}
}