I have been asked to write a public method called Caught() which takes a single argument of type LittleAlien and returns no result, for the AlienGame class. The method should check whether the argument occupies a stone corresponding to the stone occupied by the BigAlien. If so, the health of the argument should be updated accordingly.
default setting for BigAlien is 7
default setting for LittleAlien is 3
Would I need to use public void updateHealth() method in the AlienGame class? The reason I say this is iIn earlier question I was asked to write a public method called updateHealth for class LittleAlien.
public class LittleAlien extends BigAlien
{
public void updateHealth()
{
if (this.getColour() == OUColour.GREEN)
{
this.setColour(OUColour.RED);
}
else if (this.getColour() == OUColour.RED)
{
this.setColour(OUColour.BLACK);
}
}
}
public class AlienGame
{
public void Caught(LittleAlien aLalien)
{
}
}