public void ApplyParameters()
        {
            // Set the return type to the Vector class if the value returns a vector.
            if (ElementValueType == ValueType.Vector)
            {
                ReturnType = VectorType.Instance;
            }

            // Get the parameters.
            Parameters = new Parse.CodeParameter[WorkshopParameters.Length];
            for (int i = 0; i < Parameters.Length; i++)
            {
                string name        = WorkshopParameters[i].Name.Replace(" ", "");
                string description = Wiki?.GetWikiParameter(WorkshopParameters[i].Name)?.Description;

                if (WorkshopParameters[i] is VarRefParameter)
                {
                    Parameters[i] = new VariableParameter(
                        name,
                        description,
                        ((VarRefParameter)WorkshopParameters[i]).IsGlobal ? VariableType.Global : VariableType.Player,
                        new VariableResolveOptions()
                    {
                        CanBeIndexed = false, FullVariable = true
                    }
                        );
                }
                else
                {
                    CodeType codeType = null;

                    // If the parameter is an enum, get the enum CodeType.
                    if (WorkshopParameters[i] is EnumParameter)
                    {
                        codeType = WorkshopEnumType.GetEnumType(((EnumParameter)WorkshopParameters[i]).EnumData);
                    }

                    var defaultValue = WorkshopParameters[i].GetDefault();

                    Parameters[i] = new CodeParameter(
                        name,
                        description,
                        codeType,
                        defaultValue == null ? null : new ExpressionOrWorkshopValue(defaultValue)
                        );
                }
            }
        }
示例#2
0
        public void ApplyParameters()
        {
            Parameters = new Parse.CodeParameter[WorkshopParameters.Length];
            for (int i = 0; i < Parameters.Length; i++)
            {
                string name        = WorkshopParameters[i].Name.Replace(" ", "");
                string description = Wiki?.GetWikiParameter(WorkshopParameters[i].Name)?.Description;

                if (WorkshopParameters[i] is VarRefParameter)
                {
                    Parameters[i] = new WorkshopVariableParameter(
                        name,
                        description,
                        ((VarRefParameter)WorkshopParameters[i]).IsGlobal
                        );
                }
                else
                {
                    CodeType codeType = null;

                    // If the parameter is an enum, get the enum CodeType.
                    if (WorkshopParameters[i] is EnumParameter)
                    {
                        codeType = WorkshopEnumType.GetEnumType(((EnumParameter)WorkshopParameters[i]).EnumData);
                    }

                    var defaultValue = WorkshopParameters[i].GetDefault();

                    Parameters[i] = new CodeParameter(
                        name,
                        codeType,
                        defaultValue == null ? null : new ExpressionOrWorkshopValue(defaultValue),
                        description
                        );
                }
            }
        }
示例#3
0
 public override CodeParameter[] Parameters() => new CodeParameter[]
 {
     new VariableParameter("variable", "The variable to modify.", VariableType.Player),
     new CodeParameter("player", "The player whose variable will be modified. If multiple players are provided, each of their variables will be set."),
     new CodeParameter("operation", "The way in which the variable’s value will be changed. Options include standard arithmetic operations as well as array operations for appending and removing values.", WorkshopEnumType.GetEnumType <Operation>()),
     new CodeParameter("value", "The value used for the modification. For arithmetic operations, this is the second of two operands, with the other being the variable’s existing value. For array operations, this is the value to append or remove.")
 };
示例#4
0
 public override CodeParameter[] Parameters()
 {
     return(new CodeParameter[] {
         new CodeParameter("map", WorkshopEnumType.GetEnumType(EnumData.GetEnum <Map>()))
     });
 }
 public override CodeParameter[] Parameters() => new CodeParameter[]
 {
     new ModelParameter("model", "File path of the model to use. Must be a `.obj` file."),
     new CodeParameter("visibleTo", "The array of players that the model will be visible to."),
     new CodeParameter("location", "The location that the model will be shown."),
     new CodeParameter("rotation", "The rotation of the model."),
     new CodeParameter("scale", "The scale of the model."),
     new CodeParameter("reevaluation", "Specifies which of this methods' inputs will be continuously reevaluated, the model will keep asking for and using new values from reevaluated inputs.", WorkshopEnumType.GetEnumType <EffectRev>()),
     new ConstBoolParameter("getEffectIDs", "If true, the method will return the effect IDs used to create the model. Use `DestroyEffectArray()` to destroy the effect. This is a boolean constant.", false)
 };
示例#6
0
 public override CodeParameter[] Parameters() => new CodeParameter[]
 {
     new VariableParameter("variable", "The variable to manipulate. Player variables will chase the event player's variable. Must be a variable defined on the rule level.", VariableType.Dynamic, new VariableResolveOptions()
     {
         CanBeIndexed = false, FullVariable = true
     }),
     new CodeParameter("destination", "The value that the variable will eventually reach. The type of this value may be either a number or a vector, through the variable’s existing value must be of the same type before the chase begins. Can use number or vector based values."),
     new CodeParameter("rate", "The amount of change that will happen to the variable’s value each second."),
     new CodeParameter("reevaluation", "Specifies which of this action's inputs will be continuously reevaluated. This action will keep asking for and using new values from reevaluated inputs.", WorkshopEnumType.GetEnumType <RateChaseReevaluation>())
 };
 public override CodeParameter[] Parameters() => new CodeParameter[]
 {
     new EconomicTextParameter("text", "The text to display. This is a string constant."),
     new CodeParameter("visibleTo", "The array of players that the text will be visible to."),
     new CodeParameter("location", "The location to display the text."),
     new CodeParameter("rotation", "The rotation of the text."),
     new CodeParameter("scale", "The scale of the text."),
     new CodeParameter("reevaluation", "Specifies which of this methods inputs will be continuously reevaluated, the text will keep asking for and using new values from reevaluated inputs.", WorkshopEnumType.GetEnumType <EffectRev>()),
     new ConstBoolParameter("getEffectIDs", "If true, the method will return the effect IDs used to create the text. Use `DestroyEffectArray()` to destroy the effect. This is a boolean constant.", false)
 };