Skip to content

Has Unit In Opponent Range

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

This boolean is responsible by evaluate if there is a unit that has been attacked by an opponent unit.

Stand-alone application

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

HasUnitInOpponentRange(<type>)

Used in a Loop (For)

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

HasUnitInOpponentRange(<type>, <unit>)


In code (how to creat one)

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

By translate method

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

By friendly translate method

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

By formated Structured DSL Tree Pre-Order Print method

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

Clone this wiki locally