Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Direction attaquer(GameMap map, Location location, int myID) {
- Location[] locations = analyse4autourLocation(map, location);
- Direction out = null;
- int maxAdv = 0;
- for (int i = 0; i < locations.length; i++) {
- Location l = locations[i];
- Site[] analyseAut = analyse4Autour(map, location);
- int nbrAdv = 0;
- for (Site s : analyseAut) {
- if(s.owner!=myID&&s.owner!=0){
- nbrAdv++;
- }
- }
- if (nbrAdv > maxAdv) {
- maxAdv = nbrAdv;
- out = Direction.CARDINALS[0];
- }
- }
- return out;
- }
Advertisement
Add Comment
Please, Sign In to add comment