i think this method will replace the serverpopulation
No. It will not.
i think it will be called in the serverpopulation method and setActive will decide the server that will be active or not
Thinking SetActive method will look like this:
public void setActive(boolean value){
int x= Greenfoot.getRandomNumber(getWidth());
int y= Greenfoot.getRandomNumber(getHeight());
addObject(new Server(value), x, y);
}
i think it will be called in the serverpopulation method and setActive will decide the server that will be active or not
No. The method I gave decides which ones will be active. The setActive method that goes in the Server class will just set a Server object active or not active depending on the given boolean value.
i think it will be called in the serverpopulation method and setActive will decide the server that will be active or not
No. The method I gave decides which ones will be active. The setActive method that goes in the Server class will just set a Server object active or not active depending on the given boolean value.
I hope the method i wrote above is correct for setActive.
but the setActiveServers needs to be called, i think it will be called in world constructor