Ardenian
A
Ardenian
How can I write a Boolean filter to check for unit types,
filtering out if any is false ?
Example:
A unit is ground, ancient and building.
Now I load stored Boolean ( Hashtable) to check if everything is set to true:
Unit is ground == true and Loaded Boolean == true
Unit is ancient == true and Loaded Boolean == true
Unit is building == true and Loaded Boolean == true
If any condition were false, then the unit does not pass through the check
Unit is ground == true and Loaded Boolean == true
Unit is ancient == true and Loaded Boolean == false
Unit is building == true and Loaded Boolean == true
However, additionally to this, obviously a ground unit, for example, is not an air unit, even if the loaded air is true.
Unit is air == false and Loaded Boolean == true
Unit is ground == true and Loaded Boolean == true
In this case, the unit would be filtered out although it matches the conditions, because it is not an air unit.
How can I prevent this and how would a Jass script look like doing this ?
***
I would like to achieve to check for every unit type the unit is, checking a loaded Boolean to match and if any does not match, the unit does not pass the condition block.
Additionally, if the unit is not a certain type, then it should not be filtered out because the loaded Boolean does not match.
I myself can only think about a probably inefficient way, working around with ITE for every unit type, increasing an integer based on the number of unit types a unit is and so on, but I believe there is a better way.
I would be glad to receive some initial help, please.
filtering out if any is false ?
Example:
A unit is ground, ancient and building.
Now I load stored Boolean ( Hashtable) to check if everything is set to true:
Unit is ground == true and Loaded Boolean == true
Unit is ancient == true and Loaded Boolean == true
Unit is building == true and Loaded Boolean == true
If any condition were false, then the unit does not pass through the check
Unit is ground == true and Loaded Boolean == true
Unit is ancient == true and Loaded Boolean == false
Unit is building == true and Loaded Boolean == true
However, additionally to this, obviously a ground unit, for example, is not an air unit, even if the loaded air is true.
Unit is air == false and Loaded Boolean == true
Unit is ground == true and Loaded Boolean == true
In this case, the unit would be filtered out although it matches the conditions, because it is not an air unit.
How can I prevent this and how would a Jass script look like doing this ?
***
I would like to achieve to check for every unit type the unit is, checking a loaded Boolean to match and if any does not match, the unit does not pass the condition block.
Additionally, if the unit is not a certain type, then it should not be filtered out because the loaded Boolean does not match.
I myself can only think about a probably inefficient way, working around with ITE for every unit type, increasing an integer based on the number of unit types a unit is and so on, but I believe there is a better way.
I would be glad to receive some initial help, please.