package controller;

import boundary.PlayerApplication;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import model.PlayerModel;

/**
 * @author Eli Skeggs, and Nick Chaput
 */
public class PlayerScrambleCtrl implements ActionListener {
  PlayerApplication app;
  PlayerModel model;

  public PlayerScrambleCtrl(PlayerApplication app, PlayerModel model) {
    this.app = app;
    this.model = model;
  }

  public void actionPerformed(ActionEvent event) {
    // TODO: generic implementation
    // model.variation.specialMove();
  }
}

@@ -49,16 +49,17 @@
 cation;%0A
+%0A
 import j
@@ -134,25 +134,170 @@
 ort 
-model.PlayerModel
+java.util.ArrayList;%0Aimport java.util.Collections;%0A%0Aimport model.Board;%0Aimport model.CellType;%0Aimport model.PlayerModel;%0Aimport model.Tile;%0Aimport model.Variation
 ;%0A%0A/
@@ -695,14 +695,1267 @@
 Move();%0A
+%09 // System.out.println(%22Start Scramble%22);%0A%09  ArrayList%3CTile%3E tiles = new ArrayList%3CTile%3E();%0A%09  for (int x = 0; x %3C Board.width; x++) %7B%0A%09%09  for (int y = 0; y %3C Board.height; y++) %7B%0A%09%09%09  if (model.level.currentBoard.grid%5Bx%5D%5By%5D.type != CellType.INERT%0A%09%09%09%09%09  && model.level.currentBoard.grid%5Bx%5D%5By%5D.type != CellType.BUCKET%0A%09%09%09%09%09  && model.level.currentBoard.grid%5Bx%5D%5By%5D.tile != null%0A%09%09%09%09%09  && (model.level.currentBoard.grid%5Bx%5D%5By%5D.tile.number != 5%0A%09%09%09%09%09%09%09  && model.level.rules.variation != Variation.RELEASE)) %7B%0A%09%09%09%09  tiles.add(model.level.currentBoard.grid%5Bx%5D%5By%5D.tile);%0A%09%09%09%09  model.level.currentBoard.grid%5Bx%5D%5By%5D.tile = null;%0A%09%09%09  %7D%0A%09%09  %7D%0A%09  %7D%0A%09  Collections.shuffle(tiles);%0A%09  for (int x = 0; x %3C Board.width; x++) %7B%0A%09%09  for (int y = 0; y %3C Board.height; y++) %7B%0A%09%09%09  if (model.level.currentBoard.grid%5Bx%5D%5By%5D.type != CellType.INERT%0A%09%09%09%09%09  && model.level.currentBoard.grid%5Bx%5D%5By%5D.type != CellType.BUCKET%0A%09%09%09%09%09  && model.level.currentBoard.grid%5Bx%5D%5By%5D.tile == null) %7B%0A%09%09%09%09  if (tiles.get(0) != null) %7B%0A%09%09%09%09%09  model.level.currentBoard.grid%5Bx%5D%5By%5D.tile = tiles.get(0);%0A%09%09%09%09%09  tiles.remove(0);%0A%09%09%09%09  %7D%0A%09%09%09%09  else %7B%0A%09%09%09%09%09  System.out.println(%22Nick's brain has failed and you should laugh at him.%22);%0A%09%09%09%09%09  return;%0A%09%09%09%09  %7D%0A%09%09%09  %7D%0A%09%09  %7D%0A%09  %7D%0A%09  app.getView().repaint();%0A
   %7D%0A%7D%0A

Add scramble functionality