Class VariantTableExtensions
Class VariantTableExtensions.
Namespace: UnityEngine.Industrial.Configuring.Core.VariantTableExtensions
Syntax
public static class VariantTableExtensions
Methods
CanPackAddFeature(Pack, Feature, VariantTableLookup)
Report errors that would occur if a feature would be added to a pack
Declaration
public static string CanPackAddFeature(this Pack pack, Feature feature, VariantTableLookup lookup)
Parameters
Type | Name | Description |
---|---|---|
Pack | pack | The pack. |
Feature | feature | The feature. |
VariantTableLookup | lookup | The lookup. |
Returns
Type | Description |
---|---|
String | System.String. |
CreatePackSet(VariantTable, String)
Creates a new PackSet into the Variant Table. Note: All PackSet should use a root pack inside of them for re-usability purpose because we cannot assign an existing pack directly into it. Use CreatePackInPackSet() to create a root pack.
Declaration
public static PackSet CreatePackSet(this VariantTable variantTable, string code)
Parameters
Type | Name | Description |
---|---|---|
VariantTable | variantTable | The variant table. |
String | code | The code. |
Returns
Type | Description |
---|---|
PackSet | PackSet. |
DeletePack(VariantTable, Pack)
Delete Pack.
Declaration
public static bool DeletePack(this VariantTable variantTable, Pack pack)
Parameters
Type | Name | Description |
---|---|---|
VariantTable | variantTable | The variant table. |
Pack | pack | The pack. |
Returns
Type | Description |
---|---|
Boolean |
|
DeletePackSet(VariantTable, PackSet)
Delete Pack Set.
Declaration
public static bool DeletePackSet(this VariantTable variantTable, PackSet packSet)
Parameters
Type | Name | Description |
---|---|---|
VariantTable | variantTable | The variant table. |
PackSet | packSet | The pack set. |
Returns
Type | Description |
---|---|
Boolean |
|
GetAllDescendantPacks(VariantTable)
Get all the Packs from the Variant Table.
Declaration
public static List<Pack> GetAllDescendantPacks(this VariantTable variantTable)
Parameters
Type | Name | Description |
---|---|---|
VariantTable | variantTable | The variant table. |
Returns
Type | Description |
---|---|
List<Pack> | List<Pack>. |
GetAllFeatures(VariantTable)
Get all the features from the Variant Table.
Declaration
public static List<Feature> GetAllFeatures(this VariantTable variantTable)
Parameters
Type | Name | Description |
---|---|---|
VariantTable | variantTable | The variant table. |
Returns
Type | Description |
---|---|
List<Feature> | List<Feature>. |
GetConflicts(Pack, Feature, VariantTable)
Gets the conflicts.
Declaration
public static IEnumerable<Tuple<Pack, Variant, Pack, Variant>> GetConflicts(Pack pack, Feature feature, VariantTable variantTable)
Parameters
Type | Name | Description |
---|---|---|
Pack | pack | The pack. |
Feature | feature | The feature. |
VariantTable | variantTable | The variant table. |
Returns
Type | Description |
---|---|
IEnumerable<Tuple<Pack, Variant, Pack, Variant>> | IEnumerable<Tuple<Pack, Variant, Pack, Variant>>. |
GetConflicts(Pack, Feature, VariantTableLookup)
Gets the conflicts.
Declaration
public static IEnumerable<Tuple<Pack, Variant, Pack, Variant>> GetConflicts(Pack pack, Feature feature, VariantTableLookup lookup)
Parameters
Type | Name | Description |
---|---|---|
Pack | pack | The pack. |
Feature | feature | The feature. |
VariantTableLookup | lookup | The lookup. |
Returns
Type | Description |
---|---|
IEnumerable<Tuple<Pack, Variant, Pack, Variant>> | IEnumerable<Tuple<Pack, Variant, Pack, Variant>>. |
GetPackSets(VariantTable)
Get all the PackSets from the Variant Table.
Declaration
public static List<PackSet> GetPackSets(this VariantTable variantTable)
Parameters
Type | Name | Description |
---|---|---|
VariantTable | variantTable | The variant table. |
Returns
Type | Description |
---|---|
List<PackSet> | List<PackSet>. |
GetVariants(VariantTable)
Get all the Variants (Feature) from the Variant Table.
Declaration
public static List<Variant> GetVariants(this VariantTable variantTable)
Parameters
Type | Name | Description |
---|---|---|
VariantTable | variantTable | The variant table. |
Returns
Type | Description |
---|---|
List<Variant> | List<Variant>. |
GetVariantSets(VariantTable)
Get all the VariantSets (FeatureSet) from the Variant Table.
Declaration
public static List<VariantSet> GetVariantSets(this VariantTable variantTable)
Parameters
Type | Name | Description |
---|---|---|
VariantTable | variantTable | The variant table. |
Returns
Type | Description |
---|---|
List<VariantSet> | List<VariantSet>. |
IsPackAlreadyExistWithContext(Product, String, Dictionary<String, String>, List<Feature>)
Check if a Pack already exist with a "ContextRelatedData" component
Declaration
public static bool IsPackAlreadyExistWithContext(this Product product, string name, Dictionary<string, string> contextValues, List<Feature> featureList)
Parameters
Type | Name | Description |
---|---|---|
Product | product | The product. |
String | name | The name. |
Dictionary<String, String> | contextValues | The context values. |
List<Feature> | featureList | The feature list. |
Returns
Type | Description |
---|---|
Boolean |
|
WouldCauseRecursion(Pack, Feature)
Make sure that any descendant of feature is not a parent of this To avoid this case, which would cause infinite loops while switching: a b c a
Declaration
public static bool WouldCauseRecursion(this Pack pack, Feature feature)
Parameters
Type | Name | Description |
---|---|---|
Pack | pack | The pack. |
Feature | feature | The feature. |
Returns
Type | Description |
---|---|
Boolean |
|