I have basic classes
abstract class Unit {
Unit target;
abstract class UnitAI {/*...*/}
}
From these, I have derived
class Infantry extends Unit {
class InfantryAI extends UnitAI {/*...*/}
}
Can the class InfantryAI
somehow get the secondary(implicit) this
that is used for accessing the members of it's surrounding class Infantry
?
Specifically, it needs to determine if its surrounding class Infantry
is being targetted by its target, like this:
if (/*secondary_this.*/target.target == secondary_this)
or, generally, by another Unit
.