Class Index | File Index

Classes


Class AC.data.PopulationRulesParser

Defines functions for manipulation of population rules.
Defined in: Utility.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Default constructor.
Method Summary
Method Attributes Method Name and Description
 
Gets a list of all child types.
 
Gets all population rule types.
 
getDropRules(subordinateType, dropType)
Gets the drop rules properties for the specfied subordinate type and drop type
 
getRelationshipTypeFor(subordinateType, superiorType)
Gets the relationship type for the specified superior and subordinate types.
 
getRuleProperty(subordinateType, superiorType, key, index)
Gets the specified property matching superior and subordinate types starting at the specified index in the population rules array.
 
getSubordinatesOfType(superiorType, index)
Gets the array of subordinates of the specified superior type starting at the specified index.
 
Gets valid cast types on trigger-drop by iterating through the population rule array and collecting all population rule types that are valid casts.
 
getValidChildTypeList(superiorType, index)
Gets a list of all valid child types of the specified superior.
 
Checks if the array of population rules has more than one occurrence of any given type.
 
hasSubordinatesOfType(superiorType, index)
Checks if the specified superior has any subordinates.
 
isValidChildType(superiorType, childType)
Checks if the specified child is a valid child for the specified superior.
Class Detail
AC.data.PopulationRulesParser(populationRules)
Default constructor.
Parameters:
{Object[]} populationRules
The array of population rules.
Method Detail
{String[]} getAllChildTypeList(index)
Gets a list of all child types.
Parameters:
{Integer} index
The starting index into the population rules array.
Returns:
{String[]} An array of child types.

{String[]} getAllTypesList(index)
Gets all population rule types.
Parameters:
{Integer} index
The starting index into the population rules array.
Returns:
{String[]} An array of rule types.

{Object} getDropRules(subordinateType, dropType)
Gets the drop rules properties for the specfied subordinate type and drop type
Parameters:
{String} subordinateType
The contribution type of the drop target.
{String} dropType
A string representing the component drop type, expected values are: 'ctrlDropFromWithin', 'dropFromWithin', 'ctrlDropFromWithout' or 'dropFromWithout'.
Returns:
{Object} An object containing the properties of the matching drop event contribution

{String} getRelationshipTypeFor(subordinateType, superiorType)
Gets the relationship type for the specified superior and subordinate types.
Parameters:
{String} subordinateType
The subordinate type.
{String} superiorType
The superior type.
Returns:
{String} The matching relationship type if one exists or null otherwise.

{String} getRuleProperty(subordinateType, superiorType, key, index)
Gets the specified property matching superior and subordinate types starting at the specified index in the population rules array.
Parameters:
{String} subordinateType
The subordinate type.
{String} superiorType
The superior type.
{String} key
The key.
{String} index
The starting index into the population rules array
Returns:
{String} The matching property or null if no match is found.

{Object[]} getSubordinatesOfType(superiorType, index)
Gets the array of subordinates of the specified superior type starting at the specified index.
Parameters:
{String} superiorType
The superior type.
{Integer} index
The starting index into the population rules array.
Returns:
{Object[]} The array of matching subordinates.

{Boolean} getValidCastTypesOnTriggerDrop()
Gets valid cast types on trigger-drop by iterating through the population rule array and collecting all population rule types that are valid casts.
Returns:
{Boolean} The array of valid casts.

{String[]} getValidChildTypeList(superiorType, index)
Gets a list of all valid child types of the specified superior.
Parameters:
{String} superiorType
The superior type.
{Integer} index
The starting index into the population rules array.
Returns:
{String[]} An array of valid child types.

{Boolean} hasAmbiguities()
Checks if the array of population rules has more than one occurrence of any given type.
Returns:
{Boolean} True if there exists more than one rule with any given type or false otherwise.

{Boolean} hasSubordinatesOfType(superiorType, index)
Checks if the specified superior has any subordinates.
Parameters:
{String} superiorType
The superior type.
{Integer} index
The starting index into the population rules array.
Returns:
{Boolean} True if the superior has at least one subordinate or false otherwise.

{Boolean} isValidChildType(superiorType, childType)
Checks if the specified child is a valid child for the specified superior.
Parameters:
{String} superiorType
The superior type.
{String} childType
The child type.
Returns:
{Boolean} True if the child is a valid child or false otherwise

Documentation generated by JsDoc Toolkit 2.0.0 on Sun Sep 23 2012 02:46:06 GMT-0500 (CDT)