Class AssetParameterTemplate<TAsset>
- 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(AssetParameterTemplateTypeConverter))]
public class AssetParameterTemplate<TAsset> : QuestParameterTemplate<Guid>, IFormattable, IEquatable<QuestParameterTemplate<Guid>>, IEquatable<AssetParameterTemplate<TAsset>> where TAsset : Asset
Type Parameters
TAsset
- Inheritance
-
AssetParameterTemplate<TAsset>
- Implements
-
IEquatable<AssetParameterTemplate<TAsset>>
- Inherited Members
Remarks
For kit names, use KitNameParameterTemplate.
Constructors
AssetParameterTemplate()
protected AssetParameterTemplate()
AssetParameterTemplate(Guid)
Create a template of a constant value.
public AssetParameterTemplate(Guid constant)
Parameters
constantGuid
AssetParameterTemplate(Guid[], ParameterSelectionType)
Create a template of a set of values.
public AssetParameterTemplate(Guid[] values, ParameterSelectionType selectionType)
Parameters
valuesGuid[]selectionTypeParameterSelectionType
AssetParameterTemplate(ReadOnlySpan<char>)
Create a template of it's string representation.
public AssetParameterTemplate(ReadOnlySpan<char> str)
Parameters
strReadOnlySpan<char>
AssetParameterTemplate(string)
Create a template of it's string representation.
[UsedImplicitly]
public AssetParameterTemplate(string str)
Parameters
strstring
AssetParameterTemplate(ParameterSelectionType)
Create a template of a wildcard set of values.
public AssetParameterTemplate(ParameterSelectionType wildcardType)
Parameters
wildcardTypeParameterSelectionType
Properties
WildcardInclusive
A parameter value that matches any asset that is assignable to TAsset.
public static QuestParameterValue<Guid> 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<Guid>> CreateValue(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProvider
Returns
- UniTask<QuestParameterValue<Guid>>
CreateValueOnGameThread()
Creates a random value from this selective set, or a set of values if this is an inclusive set.
public QuestParameterValue<Guid> CreateValueOnGameThread()
Returns
Exceptions
- NotSupportedException
Not on the game thread.
Equals(AssetParameterTemplate<TAsset>)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(AssetParameterTemplate<TAsset> other)
Parameters
otherAssetParameterTemplate<TAsset>An object to compare with this object.
Returns
ReadJson(ref Utf8JsonReader)
Read from a JSON reader.
public static AssetParameterTemplate<TAsset>? ReadJson(ref Utf8JsonReader reader)
Parameters
readerUtf8JsonReader
Returns
- AssetParameterTemplate<TAsset>
ReadValueJson(ref Utf8JsonReader)
Read a value from a JSON reader.
public static QuestParameterValue<Guid>? 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 AssetParameterTemplate<TAsset>)
Read a AssetParameterTemplate<TAsset> from a string.
public static bool TryParse(ReadOnlySpan<char> str, out AssetParameterTemplate<TAsset> template)
Parameters
strReadOnlySpan<char>templateAssetParameterTemplate<TAsset>
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 Guid, out Guid[]?)
protected static bool TryParseIntl(ReadOnlySpan<char> str, out ParameterSelectionType selType, out ParameterValueType valType, out Guid constant, out Guid[]? list)
Parameters
strReadOnlySpan<char>selTypeParameterSelectionTypevalTypeParameterValueTypeconstantGuidlistGuid[]
Returns
TryParseValue(ReadOnlySpan<char>, out QuestParameterValue<Guid>)
Read a saved value of this AssetParameterTemplate<TAsset> from a string.
public static bool TryParseValue(ReadOnlySpan<char> str, out QuestParameterValue<Guid> value)
Parameters
strReadOnlySpan<char>valueQuestParameterValue<Guid>