I've got a class SimpleBoard that is extended by Land, which is then extended by Units. Whenever I try to compile Units, I get this error:
cannot find symbol
symbol : constructor Land()
location: class Land
public Units(int x, int y){
Thoughts on what's wrong?
EDIT: sorry, I was in a hurry! Here's the full code:
public class Units extends Land{
private int attack;
public Units(int x, int y) {
if(x==1){
attack = 1;
}
else if(x==2)
attack = 2;
else if(x==3)
attack = 4;
ar[y].AddUnit(this);
}
public int getAttack(){
return attack;
}
}
and Land
public class Land extends SimpleBoard {
private boolean barrel = false;
private boolean crown = false;
private boolean castle = false;
private boolean stronghold = false;
private int num;
private int array = 0;
public int[] adjacent;
private Units [] Occupy = new Units [4];
public Land(int z, int x, int c, int v, int b, int[] array){
if(z == 1)
barrel = true;
if(x == 1)
crown = true;
if(c == 1)
castle = true;
if (v==1)
stronghold = true;
num = b;
adjacent = array;
}
public void addUnit(Units x){
Occupy[array] = x;
array++;
}
public boolean checkB(){
return barrel;
}
public int getAdj(int i){
return adjacent[i];
}
}
And board
public class SimpleBoard {
public static Land[] ar = new Land[3];
public static void main(String[] args){
Land One = new Land(1,0,0,0,1, new int[]{2, 3});
Land Two = new Land(0,1,0,0,2, new int[]{1, 3});
Land Three = new Land(0,0,1,0,3, new int[]{1, 2});
ar[0] = One;
ar[1] = Two;
ar[2] = Three;
Units Footman = new Units(1, 1);
Units Knight = new Units(2, 3);
Units Siege = new Units(3, 2);
}
}