Hi I really need help I have triedf to make this method work and need some
guidance??
I have tried many ways to make this method work but I'm stuck completely
This is how the method is suppose to work
The int argument in the method is either 1 or 2 which represents the aliens
number in the AlienSpaceTeam.
So if the argument is 1 than a new alien will be assigned to the instance variable
navigator1
This method should assume that the alienSpaceTeam with this name already
exist, But should only add a navigator to that navigator number in the
AlienSpaceTeam if that number isnt currently occupied.If it is not occupied it should be reported in the displayPane.
I would really appreciate any help
guidance??
I have tried many ways to make this method work but I'm stuck completely
This is how the method is suppose to work
The int argument in the method is either 1 or 2 which represents the aliens
number in the AlienSpaceTeam.
So if the argument is 1 than a new alien will be assigned to the instance variable
navigator1
This method should assume that the alienSpaceTeam with this name already
exist, But should only add a navigator to that navigator number in the
AlienSpaceTeam if that number isnt currently occupied.If it is not occupied it should be reported in the displayPane.
I would really appreciate any help
Code:
public void addNavigatorToTeam(String alienName,String alienPlanet,String alienTeamName,int navigatorNumber)
{
Alien navigator = new Alien(alienName,alienPlanet);
AlienSpaceTeam name = new AlienSpaceTeam(alienTeamName);
if(navigator == name.getNavigator(1))
{
navigator = new Alien(alienName, alienPlanet);
}
if (navigatorNumber == 1)
{
navigator = new Alien(alienName, alienPlanet);
}
else
{
if (navigatorNumber == 2)
{
navigator = new Alien(alienName, alienPlanet);
}
}
}