コード例 #1
0
 @Override
 public void start(GameBoardVisual gameVisual) {
   possibleNewLocations.clear();
   for (Hex hex : gameVisual.hexVisuals().keySet()) {
     if (hex.isRobberPlaceable()) {
       if (hex.location().equals(gameVisual.game().robber().location())) {
         // Disable the current location of the robber
         gameVisual.hexVisuals().get(hex).setEnabled(false);
       } else { // A possible location to place the robber.
         possibleNewLocations.add(gameVisual.hexVisuals().get(hex));
       }
     } else {
       // Can't place a robber here, darken location
       gameVisual.hexVisuals().get(hex).setDarkened(true);
     }
   }
 }