using CommonAI.Zone.ZoneEditor.EventTrigger;
using CommonLang.Property;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CommonAI.Zone.EventTrigger
{
public interface IEditorValue
{
object GetEnvValue(IEditorValueAdapter api);
}
public interface IEventDataNode
{
///
/// 触发器名字
///
string EventName { get; set; }
///
/// 启用
///
bool EventIsActive { get; set; }
///
/// 注释
///
string EventComment { get; set; }
///
/// 保存
///
string EventTreePath { get; set; }
///
/// 延迟执行
///
int EventDelayTimeMS { get; set; }
///
/// 临时变量
///
List EventLocalVars { get; }
///
/// 事件触发
///
List EventTriggers { get; }
///
/// 条件
///
List EventConditions { get; }
///
/// 动作
///
List EventActions { get; }
///
/// 功能文本
///
///
string FunctionText();
}
[DescAttribute("临时变量")]
[Expandable]
public abstract class LocalVar
{
[DescAttribute("变量名")]
public string Key = "LocalVarName";
public abstract object GetValue(IEditorValueAdapter api, EventArguments args);
public abstract object GetAbstractValue();
}
[DescAttribute("触发事件")]
[Expandable]
public abstract class AbstractTrigger : IDisposable
{
abstract public void Listen(EventTriggerAdapter api, EventArguments args);
virtual public void Dispose() { }
}
[DescAttribute("条件")]
[Expandable]
public abstract class AbstractCondition : IDisposable
{
abstract public bool Test(EventTriggerAdapter api, EventArguments args);
virtual public void Dispose() { }
}
[DescAttribute("动作")]
[Expandable]
public abstract class AbstractAction : IDisposable
{
abstract public void DoAction(EventTriggerAdapter api, EventArguments args);
virtual public void Dispose() { }
}
[DescAttribute("抽象值")]
[Expandable]
public abstract class AbstractValue : IEditorValue
{
abstract public T GetValue(IEditorValueAdapter api, EventArguments args);
public object GetEnvValue(IEditorValueAdapter api)
{
return GetValue(api, new EventArguments());
}
}
}