Platformer Game FrameworkAIOn this pageAI Description: The singleton record to retrieve information when executing the decision tree. getUnitsByRelation Type: Function. Description: Gets an array of units in detection range that have the specified relation to current AI agent. Signature: getUnitsByRelation: function(self: AI, relation: Relation): Array Parameters: ParameterTypeDescriptionrelationRelationThe relation to filter the units by. Returns: Return TypeDescriptionArrayAn array of units with the specified relation. getDetectedUnits Type: Function. Description: Gets an array of units that the AI has detected. Signature: getDetectedUnits: function(self: AI): Array Returns: Return TypeDescriptionArrayAn array of detected units. getDetectedBodies Type: Function. Description: Gets an array of bodies that the AI has detected. Signature: getDetectedBodies: function(self: AI): Array Returns: Return TypeDescriptionArrayAn array of detected bodies. getNearestUnit Type: Function. Description: Gets the nearest unit that has the specified relation to the AI. Signature: getNearestUnit: function(self: AI, relation: Relation): Unit Parameters: ParameterTypeDescriptionrelationRelationThe relation to filter the units by. Returns: Return TypeDescriptionUnitThe nearest unit with the specified relation. getNearestUnitDistance Type: Function. Description: Gets the distance to the nearest unit that has the specified relation to the AI agent. Signature: getNearestUnitDistance: function(self: AI, relation: Relation): number Parameters: ParameterTypeDescriptionrelationRelationThe relation to filter the units by. Returns: Return TypeDescriptionnumberThe distance to the nearest unit with the specified relation. getUnitsInAttackRange Type: Function. Description: Gets an array of units that are within attack range. Signature: getUnitsInAttackRange: function(self: AI): Array Returns: Return TypeDescriptionArrayAn array of units in attack range. getBodiesInAttackRange Type: Function. Description: Gets an array of bodies that are within attack range. Signature: getBodiesInAttackRange: function(self: AI): Array Returns: Return TypeDescriptionArrayAn array of bodies in attack range.