Skip to content

Opponent Has Unit In Player Range

Rubens de Oliveira Moraes Filho edited this page Apr 29, 2021 · 2 revisions

This boolean is responsible by evaluate if there is any opponent unit within the range of an ally unit.

Stand-alone application

This method returns true if any of the opponent's unit of type <type> is within attack range of a player's unit; it returns false otherwise. OpponentHasUnitInPlayerRange can be interpreted (composed) as:

OpponentHasUnitInPlayerRange(<type>)

Used in a Loop (For)

HasNumberOfUnits can appear inside of a loop/if structure. This method returns true if the opponent's unit <unit> of type <type> is within attack range of a player's unit; it returns false otherwise. Note that the method also returns false if the type <type> given as input doesn't match the type of the unit <unit>. The parameter <unit> changes the command like the example below:

OpponentHasUnitInPlayerRange(<type>, <unit>)


In code (how to creat one)

BooleanDSL bool_example = new BooleanDSL("OpponentHasUnitInPlayerRange(Light)");

By translate method

bool_example.translate() --> print in Java console--> OpponentHasUnitInPlayerRange(Light)

By friendly translate method

bool_example.friendly_translate() --> print in Java console--> OpponentHasUnitInPlayerRange(Light)

By formated Structured DSL Tree Pre-Order Print method

BuilderDSLTreeSingleton.formatedStructuredDSLTreePreOrderPrint((iNodeDSLTree) bool_example); --> print in Java console--> b->OpponentHasUnitInPlayerRange(Light)

Clone this wiki locally