public Parameter AddParameter(Parameter parameter) { parameter.Name = NameValidation.ValidateName(parameter.Name, validationName => !Parameters.ContainsKey(validationName)); Parameters.Add(parameter.Name, parameter); return(parameter); }
public Parameter AddParameter(string name) { var parameter = new Parameter { Name = NameValidation.ValidateName(name, validationName => !Parameters.ContainsKey(validationName)) }; Parameters.Add(parameter.Name, parameter); return(parameter); }
public State AddState(State state) { state.Name = NameValidation.ValidateName(state.Name, validationName => !States.ContainsKey(validationName)); if (States.Count == 0) { CurrentState = state; state.InputPort = CreateBaseInputPort(1f); } else { state.InputPort = CreateBaseInputPort(0f); } States.Add(state.Name, state); return(state); }
private string ValidateStateName(string name) => NameValidation.ValidateName(name, validationName => !_asset.StatesEvents.Exists(state => state.Name.Equals(validationName)));
private static string ValidateEventName(string name, SerializedProperty events) => NameValidation.ValidateName(name, validationName => !events.Exists(evtAsset => evtAsset.FindPropertyRelative(nameof(StateEventAsset.Name)).stringValue.Equals(validationName)));
//public ScriptNode<T> Script<T>(string nodeName) where T: struct, IScriptNodeJob => this[nodeName] as ScriptNode<T>; #endregion Access #region Utility public string ValidateNodeName(string name) => NameValidation.ValidateName(name, validationName => !Nodes.ContainsKey(validationName));