예제 #1
0
        public Parameter AddParameter(Parameter parameter)
        {
            parameter.Name = NameValidation.ValidateName(parameter.Name, validationName => !Parameters.ContainsKey(validationName));
            Parameters.Add(parameter.Name, parameter);

            return(parameter);
        }
예제 #2
0
        public Parameter AddParameter(string name)
        {
            var parameter = new Parameter {
                Name = NameValidation.ValidateName(name, validationName => !Parameters.ContainsKey(validationName))
            };

            Parameters.Add(parameter.Name, parameter);

            return(parameter);
        }
예제 #3
0
        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)));
예제 #6
0
        //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));