Class VariantTable
Central class which holds the variant table, i.e., variants, packs, sets thereof.
Inherited Members
Namespace: UnityEngine.Industrial.Configuring.Core
Syntax
[ExecuteInEditMode]
public class VariantTable : MonoBehaviour
Fields
forceStandardConfigurationsValidation
Force all configuration to have standard validation. A valid standard configuration is one where one variant of every variant set is selected.
Declaration
[SerializeField]
public bool forceStandardConfigurationsValidation
Field Value
Type | Description |
---|---|
Boolean |
Properties
featureSets
The collection of all feature sets.
Declaration
public ReadOnlyCollection<FeatureSet> featureSets { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<FeatureSet> | The feature sets. |
GetAllAssignments
Gets the get all assignments.
Declaration
public IEnumerable<Assignment> GetAllAssignments { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Assignment> | The get all assignments. |
GetAllDeferredQueries
Gets the get all deferred queries.
Declaration
public IEnumerable<DeferredQuery> GetAllDeferredQueries { get; }
Property Value
Type | Description |
---|---|
IEnumerable<DeferredQuery> | The get all deferred queries. |
GetAllQueries
Gets the get all queries.
Declaration
public IEnumerable<QueryNode> GetAllQueries { get; }
Property Value
Type | Description |
---|---|
IEnumerable<QueryNode> | The get all queries. |
packSets
Shorthand to get a list of pack sets
Declaration
public IEnumerable<PackSet> packSets { get; }
Property Value
Type | Description |
---|---|
IEnumerable<PackSet> | The pack sets. |
product
Product to which the variant table belongs.
Declaration
public Product product { get; }
Property Value
Type | Description |
---|---|
Product | The product. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The variant table is not part of a product. |
variantSets
Shorthand to get a list of variant sets
Declaration
public IEnumerable<VariantSet> variantSets { get; }
Property Value
Type | Description |
---|---|
IEnumerable<VariantSet> | The variant sets. |
Methods
AddFeatureSet<T>(String)
Creates a new FeatureSet and returns it.
Declaration
public T AddFeatureSet<T>(string code)
where T : FeatureSet
Parameters
Type | Name | Description |
---|---|---|
String | code | Code of the feature set |
Returns
Type | Description |
---|---|
T | The feature set added |
Type Parameters
Name | Description |
---|---|
T |
AddPack(String)
Creates a new Pack and returns it.
Declaration
public Pack AddPack(string code)
Parameters
Type | Name | Description |
---|---|---|
String | code | The code. |
Returns
Type | Description |
---|---|
Pack | Pack. |
CreateDefaultConfiguration()
Creates the default configuration.
Declaration
public void CreateDefaultConfiguration()
ExecuteQueries(QueryContext)
Executes the queries.
Declaration
public void ExecuteQueries(QueryContext context = null)
Parameters
Type | Name | Description |
---|---|---|
QueryContext | context | The context. |
ForceValidConfigurations()
Forces the valid configurations.
Declaration
public void ForceValidConfigurations()
GetGroupForTag(String)
Gets the group for tag.
Declaration
public TagGroup GetGroupForTag(string tag)
Parameters
Type | Name | Description |
---|---|---|
String | tag | The tag. |
Returns
Type | Description |
---|---|
TagGroup | TagGroup. |
GetSelectedFeatures()
Returns the current selection of features as a configuration.
Declaration
public List<Feature> GetSelectedFeatures()
Returns
Type | Description |
---|---|
List<Feature> | List<Feature>. |
MoveFeatureSet(FeatureSet, Int32)
Move the feature set to index of the variant table
Declaration
public void MoveFeatureSet(FeatureSet featureSet, int index)
Parameters
Type | Name | Description |
---|---|---|
FeatureSet | featureSet | The feature set. |
Int32 | index | The index. |
Remarks
Throws an ArgumentOutOfRangeException if input index is out of range.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Feature set to move must not be null. |
ArgumentOutOfRangeException | Feature set index to move must be in range. |
Exception | Wrong expectation |
RemoveFeatureSet(FeatureSet)
Removes a FeatureSet from the variant table (along with all its variants).
Declaration
public void RemoveFeatureSet(FeatureSet featureSet)
Parameters
Type | Name | Description |
---|---|---|
FeatureSet | featureSet | The feature set. |
Remarks
Throws ArgumentException if the passed feature set is not in the variant table.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Feature set must not be null. |
ArgumentException | The feature set is not part of this variant table. |
RemovePack(Pack)
Remove Pack.
Declaration
public void RemovePack(Pack pack)
Parameters
Type | Name | Description |
---|---|---|
Pack | pack | The pack. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Pack must not be null. |
ArgumentException | The pack is not part of this variant table. |
ResetSelections()
Selects the first feature in all feature sets.
Declaration
public void ResetSelections()
Events
variantTableChanged
Occurs when [variant table changed].
Declaration
public event VariantTableChangedHandler variantTableChanged
Event Type
Type | Description |
---|---|
VariantTableChangedHandler |