Class Int32ParameterTemplate
- Namespace
- Uncreated.Warfare.Quests.Parameters
- Assembly
- Uncreated.Warfare.dll
Quest paramater template representing a set of possible values for randomly generated quests, or a set of allowed values for conditions.
[TypeConverter(typeof(Int32ParameterTemplateTypeConverter))]
public class Int32ParameterTemplate : QuestParameterTemplate<int>, IFormattable, IEquatable<QuestParameterTemplate<int>>, IEquatable<Int32ParameterTemplate>
- Inheritance
-
Int32ParameterTemplate
- Implements
- Inherited Members
Constructors
Int32ParameterTemplate()
protected Int32ParameterTemplate()
Int32ParameterTemplate(int)
Create a template of a constant value.
public Int32ParameterTemplate(int constant)
Parameters
constantint
Int32ParameterTemplate(int[], ParameterSelectionType)
Create a template of a set of values.
public Int32ParameterTemplate(int[] values, ParameterSelectionType selectionType)
Parameters
valuesint[]selectionTypeParameterSelectionType
Int32ParameterTemplate(int?, int?, ParameterSelectionType, int)
Create a template of a range of values.
public Int32ParameterTemplate(int? minValue, int? maxValue, ParameterSelectionType selectionType, int round = 0)
Parameters
minValueint?maxValueint?selectionTypeParameterSelectionTyperoundint
Int32ParameterTemplate(ReadOnlySpan<char>)
Create a template of it's string representation.
public Int32ParameterTemplate(ReadOnlySpan<char> str)
Parameters
strReadOnlySpan<char>
Int32ParameterTemplate(ParameterSelectionType)
Create a template of a wildcard set of values.
public Int32ParameterTemplate(ParameterSelectionType wildcardType)
Parameters
wildcardTypeParameterSelectionType
Properties
WildcardInclusive
A parameter value that matches any integer.
public static QuestParameterValue<int> WildcardInclusive { get; }
Property Value
Methods
CreateValue(IServiceProvider)
Creates a random value from this selective set, or a set of values if this is an inclusive set.
public override UniTask<QuestParameterValue<int>> CreateValue(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProvider
Returns
- UniTask<QuestParameterValue<int>>
Equals(Int32ParameterTemplate)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Int32ParameterTemplate other)
Parameters
otherInt32ParameterTemplateAn object to compare with this object.
Returns
ReadJson(ref Utf8JsonReader)
Read from a JSON reader.
public static Int32ParameterTemplate? ReadJson(ref Utf8JsonReader reader)
Parameters
readerUtf8JsonReader
Returns
ReadValueJson(ref Utf8JsonReader)
Read a value from a JSON reader.
public static QuestParameterValue<int>? ReadValueJson(ref Utf8JsonReader reader)
Parameters
readerUtf8JsonReader
Returns
ToString()
Convert a parameter template back to a string.
public override string ToString()
Returns
TryParse(ReadOnlySpan<char>, out Int32ParameterTemplate)
Read an Int32ParameterTemplate from a string.
public static bool TryParse(ReadOnlySpan<char> str, out Int32ParameterTemplate template)
Parameters
strReadOnlySpan<char>templateInt32ParameterTemplate
Returns
TryParseFrom(ReadOnlySpan<char>)
Read a parameter template from a string.
public override bool TryParseFrom(ReadOnlySpan<char> str)
Parameters
strReadOnlySpan<char>
Returns
TryParseIntl(ReadOnlySpan<char>, out ParameterSelectionType, out ParameterValueType, out int, out int, out int, out bool, out bool, out int, out int[]?)
protected static bool TryParseIntl(ReadOnlySpan<char> str, out ParameterSelectionType selType, out ParameterValueType valType, out int constant, out int minValue, out int maxValue, out bool minValInf, out bool maxValInf, out int round, out int[]? list)
Parameters
strReadOnlySpan<char>selTypeParameterSelectionTypevalTypeParameterValueTypeconstantintminValueintmaxValueintminValInfboolmaxValInfboolroundintlistint[]
Returns
TryParseValue(ReadOnlySpan<char>, out QuestParameterValue<int>)
Read a saved value of this Int32ParameterTemplate from a string.
public static bool TryParseValue(ReadOnlySpan<char> str, out QuestParameterValue<int> value)
Parameters
strReadOnlySpan<char>valueQuestParameterValue<int>
Returns
WriteJson(Utf8JsonWriter)
Write to a JSON writer.
public override void WriteJson(Utf8JsonWriter writer)
Parameters
writerUtf8JsonWriter