I have a class constructed like that:
public class Creature
{
protected final AI ai;
// ...about 10 other objects
public Creature (CreatureType type, int x, int y)
{
ai = new AI ();
// some other code
}
// ... many methods
}
My class AI will be an artificial intelligence of the creature. I would like it to have full access to the Creature object as if it was inside. How could I achieve that? By some tricky way to inherit it?
c.at the start to show it is the creature.creature.fieldall the time?creaturewould be a reference to the object that called theAIclass. But it's... ugly...creature.calls.