I have a class called CreatureAi with the following code.
public class CreatureAi {
public Creature creature;
public CreatureAi(Creature creature) {
this.creature = creature;
this.creature.setCreatureAi(this);
}
// There's more, I'm shortening it.
I have a class called PlayerAi which extends it.
public class PlayerAi extends CreatureAi {
private FieldOfView fov;
private Player player;
public PlayerAi(Player player, FieldOfView fov) {
this.player = player;
this.player.setCreatureAi(this);
this.fov = fov;
}
// These are the only constructors.
However, Netbeans gives me this error.
constructer CreatureAi in class CreatureAi cannot be applied to the given types.
required: Creature
found: No arguements
reason: Actual and formal lists differ in length.
Why am I getting this error?
super(creature)in first line, you don't have constructor with no-args in CreatureAi