using LinePutScript.Converter;
using LinePutScript.Localization.WPF;
using System;
using System.Linq;
namespace VPet_Simulator.Windows.Interface;
public class IText
{
///
/// 说话的内容
///
[Line(IgnoreCase = true)] public string Text { get; set; }
private string transText = null;
///
/// 说话的内容 (翻译)
///
public string TranslateText
{
get
{
if (transText == null)
{
transText = LocalizeCore.Translate(Text);
}
return transText;
}
set
{
transText = value;
}
}
///
/// 文本内容标签
///
[Line(IgnoreCase = true)]
public string Tag
{
get => string.Join(",", tags);
set => tags = value.Split(',');
}
private string[] tags = new string[] { "all" };
///
/// 查找是否符合内容标签
///
public bool FindTag(string[] tags) => tags.Any(tag => this.tags.Contains(tag));
}