using System; using System.Collections.Generic; using System.Linq; using System.Text; using CommonLang.Property; using CommonAI.Zone.Instance; using CommonAI.Zone.Attributes; using CommonAI.Zone.EventTrigger; namespace CommonAI.Zone.ZoneEditor.EventTrigger { //----------------------------------------------------------------------------------------- #region __配置扩展__ [DescAttribute("配置扩展字段(string)", "扩展字段 - 配置模板")] public class ExtConfigFieldStringValue : StringValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(string))] [DescAttribute("字段名")] public string FieldName = ""; public Type OwnerType { get { return TemplateManager.Factory.ExtConfigType; } } public override string ToString() { return string.Format("({0}).{1}", "配置扩展", FieldName); } public override string GetValue(IEditorValueAdapter api, EventArguments args) { return GameFields.GetValue(api.ZoneAPI.Templates.ExtConfig, OwnerType, FieldName); } } [DescAttribute("配置扩展字段(int)", "扩展字段 - 配置模板")] public class ExtConfigFieldIntegerValue : IntegerValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(int))] [DescAttribute("字段名")] public string FieldName = ""; public Type OwnerType { get { return TemplateManager.Factory.ExtConfigType; } } public override string ToString() { return string.Format("({0}).{1}", "配置扩展", FieldName); } public override int GetValue(IEditorValueAdapter api, EventArguments args) { return GameFields.GetValue(api.ZoneAPI.Templates.ExtConfig, OwnerType, FieldName); } } [DescAttribute("配置扩展字段(float)", "扩展字段 - 配置模板")] public class ExtConfigFieldRealValue : RealValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(float))] [DescAttribute("字段名")] public string FieldName = ""; public Type OwnerType { get { return TemplateManager.Factory.ExtConfigType; } } public override string ToString() { return string.Format("({0}).{1}", "配置扩展", FieldName); } public override float GetValue(IEditorValueAdapter api, EventArguments args) { return GameFields.GetValue(api.ZoneAPI.Templates.ExtConfig, OwnerType, FieldName); } } [DescAttribute("配置扩展字段(bool)", "扩展字段 - 配置模板")] public class ExtConfigFieldBoolValue : BooleanValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(bool))] [DescAttribute("字段名")] public string FieldName = ""; public Type OwnerType { get { return TemplateManager.Factory.ExtConfigType; } } public override string ToString() { return string.Format("({0}).{1}", "配置扩展", FieldName); } public override bool GetValue(IEditorValueAdapter api, EventArguments args) { return GameFields.GetValue(api.ZoneAPI.Templates.ExtConfig, OwnerType, FieldName); } } #endregion //----------------------------------------------------------------------------------------- #region __场景扩展__ [DescAttribute("场景扩展字段(string)", "扩展字段 - 场景模板")] public class ZonePropertiesFieldStringValue : StringValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(string))] [DescAttribute("字段名")] public string FieldName = ""; public Type OwnerType { get { return TemplateManager.Factory.ScenePropertiesType; } } public override string ToString() { return string.Format("({0}).{1}", "场景扩展", FieldName); } public override string GetValue(IEditorValueAdapter api, EventArguments args) { return GameFields.GetValue((api.ZoneAPI as EditorScene).Data.Properties, OwnerType, FieldName); } } [DescAttribute("场景扩展字段(int)", "扩展字段 - 场景模板")] public class ZonePropertiesFieldIntegerValue : IntegerValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(int))] [DescAttribute("字段名")] public string FieldName = ""; public Type OwnerType { get { return TemplateManager.Factory.ScenePropertiesType; } } public override string ToString() { return string.Format("({0}).{1}", "场景扩展", FieldName); } public override int GetValue(IEditorValueAdapter api, EventArguments args) { return GameFields.GetValue((api.ZoneAPI as EditorScene).Data.Properties, OwnerType, FieldName); } } [DescAttribute("场景扩展字段(float)", "扩展字段 - 场景模板")] public class ZonePropertiesFieldRealValue : RealValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(float))] [DescAttribute("字段名")] public string FieldName = ""; public Type OwnerType { get { return TemplateManager.Factory.ScenePropertiesType; } } public override string ToString() { return string.Format("({0}).{1}", "场景扩展", FieldName); } public override float GetValue(IEditorValueAdapter api, EventArguments args) { return GameFields.GetValue((api.ZoneAPI as EditorScene).Data.Properties, OwnerType, FieldName); } } [DescAttribute("场景扩展字段(bool)", "扩展字段 - 场景模板")] public class ZonePropertiesFieldBoolValue : BooleanValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(bool))] [DescAttribute("字段名")] public string FieldName = ""; public Type OwnerType { get { return TemplateManager.Factory.ScenePropertiesType; } } public override string ToString() { return string.Format("({0}).{1}", "场景扩展", FieldName); } public override bool GetValue(IEditorValueAdapter api, EventArguments args) { return GameFields.GetValue((api.ZoneAPI as EditorScene).Data.Properties, OwnerType, FieldName); } } #endregion //----------------------------------------------------------------------------------------- #region __单位扩展__ [DescAttribute("单位扩展字段(string)", "扩展字段 - 单位模板")] public class UnitPropertiesFieldStringValue : StringValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(string))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("单位")] public UnitValue Unit = new UnitValue.Trigging(); public Type OwnerType { get { return TemplateManager.Factory.UnitPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Unit, FieldName); } public override string GetValue(IEditorValueAdapter api, EventArguments args) { InstanceUnit o = Unit.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Info.Properties, OwnerType, FieldName); } return null; } } [DescAttribute("单位扩展字段(int)", "扩展字段 - 单位模板")] public class UnitPropertiesFieldIntegerValue : IntegerValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(int))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("单位")] public UnitValue Unit = new UnitValue.Trigging(); public Type OwnerType { get { return TemplateManager.Factory.UnitPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Unit, FieldName); } public override int GetValue(IEditorValueAdapter api, EventArguments args) { InstanceUnit o = Unit.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Info.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("单位扩展字段(float)", "扩展字段 - 单位模板")] public class UnitPropertiesFieldRealValue : RealValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(float))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("单位")] public UnitValue Unit = new UnitValue.Trigging(); public Type OwnerType { get { return TemplateManager.Factory.UnitPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Unit, FieldName); } public override float GetValue(IEditorValueAdapter api, EventArguments args) { InstanceUnit o = Unit.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Info.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("单位扩展字段(bool)", "扩展字段 - 单位模板")] public class UnitPropertiesFieldBoolValue : BooleanValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(bool))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("单位")] public UnitValue Unit = new UnitValue.Trigging(); public Type OwnerType { get { return TemplateManager.Factory.UnitPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Unit, FieldName); } public override bool GetValue(IEditorValueAdapter api, EventArguments args) { InstanceUnit o = Unit.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Info.Properties, OwnerType, FieldName); } return false; } } #endregion //----------------------------------------------------------------------------------------- #region __物品扩展__ [DescAttribute("物品扩展字段(string)", "扩展字段 - 物品模板")] public class ItemPropertiesFieldStringValue : StringValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(string))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("物品")] public ItemTemplateValue Item = new ItemTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.ItemPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Item, FieldName); } public override string GetValue(IEditorValueAdapter api, EventArguments args) { ItemTemplate o = Item.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return null; } } [DescAttribute("物品扩展字段(int)", "扩展字段 - 物品模板")] public class ItemPropertiesFieldIntegerValue : IntegerValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(int))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("物品")] public ItemTemplateValue Item = new ItemTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.ItemPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Item, FieldName); } public override int GetValue(IEditorValueAdapter api, EventArguments args) { ItemTemplate o = Item.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("物品扩展字段(float)", "扩展字段 - 物品模板")] public class ItemPropertiesFieldRealValue : RealValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(float))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("物品")] public ItemTemplateValue Item = new ItemTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.ItemPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Item, FieldName); } public override float GetValue(IEditorValueAdapter api, EventArguments args) { ItemTemplate o = Item.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("物品扩展字段(bool)", "扩展字段 - 物品模板")] public class ItemPropertiesFieldBoolValue : BooleanValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(bool))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("物品")] public ItemTemplateValue Item = new ItemTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.ItemPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Item, FieldName); } public override bool GetValue(IEditorValueAdapter api, EventArguments args) { ItemTemplate o = Item.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return false; } } #endregion //----------------------------------------------------------------------------------------- #region __技能扩展__ [DescAttribute("技能扩展字段(string)", "扩展字段 - 技能模板")] public class SkillPropertiesFieldStringValue : StringValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(string))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("技能")] public SkillTemplateValue Skill = new SkillTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.SkillPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Skill, FieldName); } public override string GetValue(IEditorValueAdapter api, EventArguments args) { SkillTemplate o = Skill.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return null; } } [DescAttribute("技能扩展字段(int)", "扩展字段 - 技能模板")] public class SkillPropertiesFieldIntegerValue : IntegerValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(int))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("技能")] public SkillTemplateValue Skill = new SkillTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.SkillPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Skill, FieldName); } public override int GetValue(IEditorValueAdapter api, EventArguments args) { SkillTemplate o = Skill.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("技能扩展字段(float)", "扩展字段 - 技能模板")] public class SkillPropertiesFieldRealValue : RealValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(float))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("技能")] public SkillTemplateValue Skill = new SkillTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.SkillPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Skill, FieldName); } public override float GetValue(IEditorValueAdapter api, EventArguments args) { SkillTemplate o = Skill.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("技能扩展字段(bool)", "扩展字段 - 技能模板")] public class SkillPropertiesFieldBoolValue : BooleanValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(bool))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("技能")] public SkillTemplateValue Skill = new SkillTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.SkillPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Skill, FieldName); } public override bool GetValue(IEditorValueAdapter api, EventArguments args) { SkillTemplate o = Skill.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return false; } } #endregion //----------------------------------------------------------------------------------------- #region __法术扩展__ [DescAttribute("法术扩展字段(string)", "扩展字段 - 法术模板")] public class SpellPropertiesFieldStringValue : StringValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(string))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("法术")] public SpellTemplateValue Spell = new SpellTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.SpellPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Spell, FieldName); } public override string GetValue(IEditorValueAdapter api, EventArguments args) { SpellTemplate o = Spell.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return null; } } [DescAttribute("法术扩展字段(int)", "扩展字段 - 法术模板")] public class SpellPropertiesFieldIntegerValue : IntegerValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(int))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("法术")] public SpellTemplateValue Spell = new SpellTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.SpellPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Spell, FieldName); } public override int GetValue(IEditorValueAdapter api, EventArguments args) { SpellTemplate o = Spell.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("法术扩展字段(float)", "扩展字段 - 法术模板")] public class SpellPropertiesFieldRealValue : RealValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(float))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("法术")] public SpellTemplateValue Spell = new SpellTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.SpellPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Spell, FieldName); } public override float GetValue(IEditorValueAdapter api, EventArguments args) { SpellTemplate o = Spell.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("法术扩展字段(bool)", "扩展字段 - 法术模板")] public class SpellPropertiesFieldBoolValue : BooleanValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(bool))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("法术")] public SpellTemplateValue Spell = new SpellTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.SpellPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Spell, FieldName); } public override bool GetValue(IEditorValueAdapter api, EventArguments args) { SpellTemplate o = Spell.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return false; } } #endregion //----------------------------------------------------------------------------------------- #region __BUFF扩展__ [DescAttribute("BUFF扩展字段(string)", "扩展字段 - BUFF模板")] public class BuffPropertiesFieldStringValue : StringValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(string))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("BUFF")] public BuffTemplateValue Buff = new BuffTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.BuffPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Buff, FieldName); } public override string GetValue(IEditorValueAdapter api, EventArguments args) { BuffTemplate o = Buff.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return null; } } [DescAttribute("BUFF扩展字段(int)", "扩展字段 - BUFF模板")] public class BuffPropertiesFieldIntegerValue : IntegerValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(int))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("BUFF")] public BuffTemplateValue Buff = new BuffTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.BuffPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Buff, FieldName); } public override int GetValue(IEditorValueAdapter api, EventArguments args) { BuffTemplate o = Buff.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("BUFF扩展字段(float)", "扩展字段 - BUFF模板")] public class BuffPropertiesFieldRealValue : RealValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(float))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("BUFF")] public BuffTemplateValue Buff = new BuffTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.BuffPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Buff, FieldName); } public override float GetValue(IEditorValueAdapter api, EventArguments args) { BuffTemplate o = Buff.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return 0; } } [DescAttribute("BUFF扩展字段(bool)", "扩展字段 - BUFF模板")] public class BuffPropertiesFieldBoolValue : BooleanValue, IFieldMemberValue { [ObjectMemberNameAttribute(typeof(bool))] [DescAttribute("字段名")] public string FieldName = ""; [DescAttribute("BUFF")] public BuffTemplateValue Buff = new BuffTemplateValue.Template(); public Type OwnerType { get { return TemplateManager.Factory.BuffPropertiesType; } } public override string ToString() { return string.Format("({0}).扩展.{1}", Buff, FieldName); } public override bool GetValue(IEditorValueAdapter api, EventArguments args) { BuffTemplate o = Buff.GetValue(api, args); if (o != null) { return GameFields.GetValue(o.Properties, OwnerType, FieldName); } return false; } } #endregion //----------------------------------------------------------------------------------------- }