Table of Contents

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

constant int

Int32ParameterTemplate(int[], ParameterSelectionType)

Create a template of a set of values.

public Int32ParameterTemplate(int[] values, ParameterSelectionType selectionType)

Parameters

values int[]
selectionType ParameterSelectionType

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

minValue int?
maxValue int?
selectionType ParameterSelectionType
round int

Int32ParameterTemplate(ReadOnlySpan<char>)

Create a template of it's string representation.

public Int32ParameterTemplate(ReadOnlySpan<char> str)

Parameters

str ReadOnlySpan<char>

Int32ParameterTemplate(ParameterSelectionType)

Create a template of a wildcard set of values.

public Int32ParameterTemplate(ParameterSelectionType wildcardType)

Parameters

wildcardType ParameterSelectionType

Properties

WildcardInclusive

A parameter value that matches any integer.

public static QuestParameterValue<int> WildcardInclusive { get; }

Property Value

QuestParameterValue<int>

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

serviceProvider IServiceProvider

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

other Int32ParameterTemplate

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

ReadJson(ref Utf8JsonReader)

Read from a JSON reader.

public static Int32ParameterTemplate? ReadJson(ref Utf8JsonReader reader)

Parameters

reader Utf8JsonReader

Returns

Int32ParameterTemplate

ReadValueJson(ref Utf8JsonReader)

Read a value from a JSON reader.

public static QuestParameterValue<int>? ReadValueJson(ref Utf8JsonReader reader)

Parameters

reader Utf8JsonReader

Returns

QuestParameterValue<int>

ToString()

Convert a parameter template back to a string.

public override string ToString()

Returns

string

TryParse(ReadOnlySpan<char>, out Int32ParameterTemplate)

Read an Int32ParameterTemplate from a string.

public static bool TryParse(ReadOnlySpan<char> str, out Int32ParameterTemplate template)

Parameters

str ReadOnlySpan<char>
template Int32ParameterTemplate

Returns

bool

TryParseFrom(ReadOnlySpan<char>)

Read a parameter template from a string.

public override bool TryParseFrom(ReadOnlySpan<char> str)

Parameters

str ReadOnlySpan<char>

Returns

bool

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

str ReadOnlySpan<char>
selType ParameterSelectionType
valType ParameterValueType
constant int
minValue int
maxValue int
minValInf bool
maxValInf bool
round int
list int[]

Returns

bool

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

str ReadOnlySpan<char>
value QuestParameterValue<int>

Returns

bool

WriteJson(Utf8JsonWriter)

Write to a JSON writer.

public override void WriteJson(Utf8JsonWriter writer)

Parameters

writer Utf8JsonWriter