Table of Contents

Class SingleParameterTemplate

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(SingleParameterTemplateTypeConverter))]
public class SingleParameterTemplate : QuestParameterTemplate<float>, IFormattable, IEquatable<QuestParameterTemplate<float>>, IEquatable<SingleParameterTemplate>
Inheritance
SingleParameterTemplate
Implements
Inherited Members

Constructors

SingleParameterTemplate()

protected SingleParameterTemplate()

SingleParameterTemplate(float?, float?, ParameterSelectionType, int)

Create a template of a range of values.

public SingleParameterTemplate(float? minValue, float? maxValue, ParameterSelectionType selectionType, int round = 0)

Parameters

minValue float?
maxValue float?
selectionType ParameterSelectionType
round int

SingleParameterTemplate(ReadOnlySpan<char>)

Create a template of it's string representation.

public SingleParameterTemplate(ReadOnlySpan<char> str)

Parameters

str ReadOnlySpan<char>

SingleParameterTemplate(float)

Create a template of a constant value.

public SingleParameterTemplate(float constant)

Parameters

constant float

SingleParameterTemplate(float[], ParameterSelectionType)

Create a template of a set of values.

public SingleParameterTemplate(float[] values, ParameterSelectionType selectionType)

Parameters

values float[]
selectionType ParameterSelectionType

SingleParameterTemplate(ParameterSelectionType)

Create a template of a wildcard set of values.

public SingleParameterTemplate(ParameterSelectionType wildcardType)

Parameters

wildcardType ParameterSelectionType

Properties

WildcardInclusive

A parameter value that matches any integer.

public static QuestParameterValue<float> WildcardInclusive { get; }

Property Value

QuestParameterValue<float>

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<float>> CreateValue(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

Returns

UniTask<QuestParameterValue<float>>

Equals(SingleParameterTemplate)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(SingleParameterTemplate other)

Parameters

other SingleParameterTemplate

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 SingleParameterTemplate? ReadJson(ref Utf8JsonReader reader)

Parameters

reader Utf8JsonReader

Returns

SingleParameterTemplate

ReadValueJson(ref Utf8JsonReader)

Read a value from a JSON reader.

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

Parameters

reader Utf8JsonReader

Returns

QuestParameterValue<float>

ToString()

Convert a parameter template back to a string.

public override string ToString()

Returns

string

TryParse(ReadOnlySpan<char>, out SingleParameterTemplate)

Read a SingleParameterTemplate from a string.

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

Parameters

str ReadOnlySpan<char>
template SingleParameterTemplate

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 float, out float, out float, out bool, out bool, out int, out float[]?)

protected static bool TryParseIntl(ReadOnlySpan<char> str, out ParameterSelectionType selType, out ParameterValueType valType, out float constant, out float minValue, out float maxValue, out bool minValInf, out bool maxValInf, out int round, out float[]? list)

Parameters

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

Returns

bool

TryParseValue(ReadOnlySpan<char>, out QuestParameterValue<float>)

Read a saved value of this SingleParameterTemplate from a string.

public static bool TryParseValue(ReadOnlySpan<char> str, out QuestParameterValue<float> value)

Parameters

str ReadOnlySpan<char>
value QuestParameterValue<float>

Returns

bool

WriteJson(Utf8JsonWriter)

Write to a JSON writer.

public override void WriteJson(Utf8JsonWriter writer)

Parameters

writer Utf8JsonWriter