// Path: PacMan-vs-Ghosts/src/game/controllers/ghosts/GhostsActions.java
// public final class GhostsActions {
// 	
// 	private static GhostAction NONE;
// 	
// 	public GhostAction[] actions = new GhostAction[4];
// 	
// 	public final int ghostCount;	
// 	
// 	public boolean pauseSimulation;
// 	public boolean nextFrame;
// 	
// 	public GhostsActions(int ghostCount) {
// 		this.ghostCount = ghostCount;
// 		for (int i = 0; i < actions.length; ++i) {
// 			actions[i] = new GhostAction();
// 		}
// 	}
// 	
// 	public GhostAction ghost(int index) {
// 		if (index < 0 || index > actions.length) return NONE;
// 		return actions[index];
// 	}
// 	
// 	public void set(int[] directions) {
// 		for (int i = 0; i < directions.length && i < actions.length; ++i) {
// 			actions[i].set(directions[i]);
// 		}
// 	}
// 	
// 	public GhostAction blinky() {
// 		return actions[GhostType.BLINKY.index];
// 	}
// 	
// 	public GhostAction pinky() {
// 		return actions[GhostType.PINKY.index];
// 	}
// 	
// 	public GhostAction clyde() {
// 		return actions[GhostType.CLYDE.index];
// 	}
// 	
// 	public GhostAction inky() {
// 		return actions[GhostType.INKY.index];
// 	}
// 	
// 	public void pause() {
// 		pauseSimulation = true;
// 	}
// 	
// 	public void resume() {
// 		pauseSimulation = false;
// 	}
// 	
// 	public void togglePause() {
// 		pauseSimulation = !pauseSimulation;
// 	}
// 	
// 	public void reset() {
// 		for (int i = 0; i < actions.length; ++i) {
// 			actions[i].reset();
// 		}
// 		pauseSimulation = false;
// 		nextFrame = false;
// 	}		
// 	
// 	public GhostsActions clone() {
// 		GhostsActions result = new GhostsActions(ghostCount);
// 		
// 		for (int i = 0; i < actions.length; ++i) {
// 			result.actions[i] = actions[i].clone();
// 		}
// 		result.pauseSimulation = pauseSimulation;
// 		result.nextFrame = nextFrame;
// 		
// 		return result;
// 	}
// 
// 	
// 
// }


import java.util.Arrays;
import game.controllers.ghosts.GhostsActions;
package game.core;



/**
 * This class is to replay games that were recorded using Replay. The only differences are:
 * 1. Ghost reversals are removed
 * 2. Directions are not checked (since they are necessarily valid)
 * This class should only be used in conjunction with stored directions, not to play the game itself.
 */
public final class _RG_ extends _G_
{	
	//Updates the locations of the ghosts without reversals
// Path: PacMan-vs-Ghosts/src/game/controllers/ghosts/GhostsActions.java
// public final class GhostsActions {
// 	
// 	private static GhostAction NONE;
// 	
// 	public GhostAction[] actions = new GhostAction[4];
// 	
// 	public final int ghostCount;	
// 	
// 	public boolean pauseSimulation;
// 	public boolean nextFrame;
// 	
// 	public GhostsActions(int ghostCount) {
// 		this.ghostCount = ghostCount;
// 		for (int i = 0; i < actions.length; ++i) {
// 			actions[i] = new GhostAction();
// 		}
// 	}
// 	
// 	public GhostAction ghost(int index) {
// 		if (index < 0 || index > actions.length) return NONE;
// 		return actions[index];
// 	}
// 	
// 	public void set(int[] directions) {
// 		for (int i = 0; i < directions.length && i < actions.length; ++i) {
// 			actions[i].set(directions[i]);
// 		}
// 	}
// 	
// 	public GhostAction blinky() {
// 		return actions[GhostType.BLINKY.index];
// 	}
// 	
// 	public GhostAction pinky() {
// 		return actions[GhostType.PINKY.index];
// 	}
// 	
// 	public GhostAction clyde() {
// 		return actions[GhostType.CLYDE.index];
// 	}
// 	
// 	public GhostAction inky() {
// 		return actions[GhostType.INKY.index];
// 	}
// 	
// 	public void pause() {
// 		pauseSimulation = true;
// 	}
// 	
// 	public void resume() {
// 		pauseSimulation = false;
// 	}
// 	
// 	public void togglePause() {
// 		pauseSimulation = !pauseSimulation;
// 	}
// 	
// 	public void reset() {
// 		for (int i = 0; i < actions.length; ++i) {
// 			actions[i].reset();
// 		}
// 		pauseSimulation = false;
// 		nextFrame = false;
// 	}		
// 	
// 	public GhostsActions clone() {
// 		GhostsActions result = new GhostsActions(ghostCount);
// 		
// 		for (int i = 0; i < actions.length; ++i) {
// 			result.actions[i] = actions[i].clone();
// 		}
// 		result.pauseSimulation = pauseSimulation;
// 		result.nextFrame = nextFrame;
// 		
// 		return result;
// 	}
// 
// 	
// 
// }


// Path: PacMan-vs-Ghosts/src/game/core/_RG_.java
import java.util.Arrays;
import game.controllers.ghosts.GhostsActions;

package game.core;



/**
 * This class is to replay games that were recorded using Replay. The only differences are:
 * 1. Ghost reversals are removed
 * 2. Directions are not checked (since they are necessarily valid)
 * This class should only be used in conjunction with stored directions, not to play the game itself.
 */
public final class _RG_ extends _G_
{	
	//Updates the locations of the ghosts without reversals
	protected void updateGhosts(GhostsActions ghosts, boolean reverse)