AI
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:
Parameter | Type | Description |
---|---|---|
relation | Relation | The relation to filter the units by. |
Returns:
Return Type | Description |
---|---|
Array | An 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 Type | Description |
---|---|
Array | An 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 Type | Description |
---|---|
Array | An 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:
Parameter | Type | Description |
---|---|---|
relation | Relation | The relation to filter the units by. |
Returns:
Return Type | Description |
---|---|
Unit | The 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:
Parameter | Type | Description |
---|---|---|
relation | Relation | The relation to filter the units by. |
Returns:
Return Type | Description |
---|---|
number | The 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 Type | Description |
---|---|
Array | An 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 Type | Description |
---|---|
Array | An array of bodies in attack range. |