Class QuestParameterValue<TValue>
- Namespace
- Uncreated.Warfare.Quests.Parameters
- Assembly
- Uncreated.Warfare.dll
[JsonConverter(typeof(QuestParameterConverter))]
public abstract class QuestParameterValue<TValue> : IFormattable, IEquatable<QuestParameterValue<TValue>>
Type Parameters
TValue
- Inheritance
-
QuestParameterValue<TValue>
- Implements
-
IEquatable<QuestParameterValue<TValue>>
- Derived
- Inherited Members
- Extension Methods
Properties
SelectionType
Selection style of the parameter. Inclusive allows any value in the set, where selective selects one value in the set.
public ParameterSelectionType SelectionType { get; protected set; }
Property Value
ValueType
Type of value set. Constant, list, wildcard, and sometimes range.
public ParameterValueType ValueType { get; protected set; }
Property Value
Methods
Equals(QuestParameterValue<TValue>?)
Indicates whether the current object is equal to another object of the same type.
public abstract bool Equals(QuestParameterValue<TValue>? other)
Parameters
otherQuestParameterValue<TValue>An object to compare with this object.
Returns
GetDisplayString(ITranslationValueFormatter)
Creates a string for use in translations.
public abstract object GetDisplayString(ITranslationValueFormatter formatter)
Parameters
formatterITranslationValueFormatter
Returns
GetSingleValue()
Get one value to use. Must either be a constant or selective.
public abstract TValue GetSingleValue()
Returns
- TValue
Exceptions
- InvalidOperationException
Inclusive selection is not supported when getting a single value.
GetSingleValueOrMaximum()
Get one value to use. If this is a range or list it'll return the maximum of the set.
public virtual TValue GetSingleValueOrMaximum()
Returns
- TValue
Exceptions
- InvalidOperationException
Inclusive selection is not supported when getting a single value for this type.
GetSingleValueOrMinimum()
Get one value to use. If this is a range or list it'll return the minimum of the set.
public virtual TValue GetSingleValueOrMinimum()
Returns
- TValue
Exceptions
- InvalidOperationException
Inclusive selection is not supported when getting a single value for this type.
IsMatch(TValue)
Compare a value against the current value of this parameter. Best used with inclusive selection.
public abstract bool IsMatch(TValue otherValue)
Parameters
otherValueTValue
Returns
ToString()
Convert a parameter value back to a string.
public override abstract string ToString()
Returns
WriteJson(Utf8JsonWriter)
Write to a JSON writer.
public virtual void WriteJson(Utf8JsonWriter writer)
Parameters
writerUtf8JsonWriter