<< Click to Display Table of Contents >> Navigation: »No topics above this level« Segment and Command List Inheritance Rules |
Lists in Segments and Commands "inherit up" their values from the default values listed in SegmentGroup and RangeScripts. Meaning, if a value is listed in a list in RangeScripts.DefaultSegment or .DefaultCommand, or listed in a SegmentGroup.DefaultSegment or DefaultCommand, that value is automatically included in the attribute list in Segment or Command.
There are two ways to override this behavior.
•Pre-pend a list value with "!" to remove it from the inherited default list.
•Include the word CONSTANT, to ignore all values in the default list.
For example, consider the following definition for Segment.ShotAttributes. Please note, all other attributes have purposefully been left out for the sake of clarity.
{
"RangeScripts" : {
"DefaultSegment" : { "ShotAttributes" : ["SIGHTER"] },
"SegmentGroup" : {
"DefaultSegment" : {},
"Segments" : [
{ "SegmentName" : "Pre-Competition", "ShotAttributes" : ["STOP"] },
{ "SegmentName" : "Sighters", "ShotAttributes" : [] }
{ "SegmentName" : "Competition", "ShotAttributes" : ["!SIGHTER"] }
{ "SegmentName" : "Post-Competition", "ShotAttributes" : ["STOP", "CONSTANT"] }
]
}
}
}
The ShotAtttibute list, for each segment would then be calculated as.
Segment Name |
ShotAttribute List Values |
Explanation |
Pre-Competition |
["SIGHTER", "STOP"] |
SIGHTER is inherited from the DefaultSegment in RangeScripts. STOP is explicitly listed in the segment. |
Sighters |
["SIGHTER"] |
SIGHTER is inherited from the DefaultSegment in RangeScripts. |
Competition |
[] (and empty list) |
SIGHTER is removed from the inheritance because it is pre-pended with an explanation point. |
Post-Competition |
["STOP"] |
By using the value CONSTANT all inheritance is ignored, and only the values listed are used. Which in this case is STOP. |