/// <summary> /// Creates a result from the error check. /// </summary> /// <param name="node">The node we checked.</param> /// <param name="level">The type of message we want to post.</param> /// <param name="description">The posted message.</param> public ErrorCheck(Node node, ErrorCheckLevel level, string description) { _node = node; _level = level; _description = description; if (_node != null) { _description = string.Format("{0}({1}) : {2}", _node.Label, _node.Id, description); } }
public override void CheckForErrors(BehaviorNode rootBehavior, List <ErrorCheck> result) { if (this.Method == null #if USE_NOOP || this.Method == MethodDef.Noop #endif//#if USE_NOOP ) { result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.NoMethod)); } else { bool isParamCompleted = true; foreach (MethodDef.Param param in this.Method.Params) { if (param.Value == null) { isParamCompleted = false; break; } } if (!isParamCompleted) { result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.NoParam)); } if (this.Method.NativeReturnType != "behaviac::EBTStatus") { if (EBTStatus.BT_INVALID == this.ResultOption) { if (this.ResultFunctor == null) { ErrorCheckLevel checkLevel = ms_NoResultTreatAsError ? ErrorCheckLevel.Error : ErrorCheckLevel.Warning; result.Add(new Node.ErrorCheck(this, checkLevel, Resources.NoResultFunctor)); } else if (!Plugin.IsMatchedStatusMethod(this.Method, this.ResultFunctor)) { result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.WrongResultFunctor)); } } } } base.CheckForErrors(rootBehavior, result); }
public override void CheckForErrors(BehaviorNode rootBehavior, List <ErrorCheck> result) { if (this.Method == null #if USE_NOOP || this.Method == MethodDef.Noop #endif//#if USE_NOOP ) { bool bAllowNullMethod = false; System.Reflection.PropertyInfo fi = this.GetType().GetProperty("Method"); Attribute[] attributes = (Attribute[])fi.GetCustomAttributes(typeof(DesignerMethodEnum), false); if (attributes.Length > 0) { DesignerMethodEnum designerProperty = ((DesignerMethodEnum)attributes[0]); if ((designerProperty.MethodType & MethodType.AllowNullMethod) == MethodType.AllowNullMethod) { bAllowNullMethod = true; } } if (!bAllowNullMethod) { result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.NoMethod)); } } else { bool isParamCompleted = true; foreach (MethodDef.Param param in this.Method.Params) { if (param.Value == null) { isParamCompleted = false; break; } } if (!isParamCompleted) { result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.NoParam)); } if (this.Method.NativeReturnType != "behaviac::EBTStatus") { if (EBTStatus.BT_INVALID == this.ResultOption) { if (this.ResultFunctor == null) { ErrorCheckLevel checkLevel = ms_NoResultTreatAsError ? ErrorCheckLevel.Error : ErrorCheckLevel.Warning; result.Add(new Node.ErrorCheck(this, checkLevel, Resources.NoResultFunctor)); } else if (!Plugin.IsMatchedStatusMethod(this.Method, this.ResultFunctor)) { result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.WrongResultFunctor)); } } } } base.CheckForErrors(rootBehavior, result); }
/// <summary> /// Creates a result from the error check. /// </summary> /// <param name="node">The node we checked.</param> /// <param name="level">The type of message we want to post.</param> /// <param name="description">The posted message.</param> public ErrorCheck(Node node, ErrorCheckLevel level, string description) { _node = node; _level = level; _description = description; }
public ErrorCheck(Node node, string label, ErrorCheckLevel level, string description) { _node = node; _level = level; _description = label + " : " + description; }
public static List<Node.ErrorCheck> GetErrorChecks(List<Node.ErrorCheck> errorChecks, ErrorCheckLevel errorLevel = ErrorCheckLevel.Error) { List<Node.ErrorCheck> errors = new List<Node.ErrorCheck>(); foreach(Node.ErrorCheck error in errorChecks) { if (errorLevel == error.Level) { errors.Add(error); } } return errors; }
/// <summary> /// Creates a result from the error check. /// </summary> /// <param name="node">The node we checked.</param> /// <param name="level">The type of message we want to post.</param> /// <param name="description">The posted message.</param> public ErrorCheck(Node node, ErrorCheckLevel level, string description) { _node= node; _level= level; _description= description; }
public ErrorCheck(Node node, int id, string label, ErrorCheckLevel level, string description) { _node = node; _level = level; _description = string.Format("{0}({1}) : {2}", label, id, description); }
/// <summary> /// Creates a result from the error check. /// </summary> /// <param name="node">The node we checked.</param> /// <param name="level">The type of message we want to post.</param> /// <param name="description">The posted message.</param> public ErrorCheck(Node node, ErrorCheckLevel level, string description) { _node = node; _level = level; _description = description; if (_node != null) _description = string.Format("{0}({1}) : {2}", _node.Label, _node.Id, description); }