<commit_before>package model.game;

import model.map.GameMap;
import model.map.tile.Tile;
import model.phase.ModelMediator;
import model.phase.PhaseManager;
import model.phase.observers.PhaseObserver;
import model.phase.visitors.PhaseNotificationVisitor;
import model.player.Player;
import model.utilities.FileUtilities;

/**
 * Created by TheNotoriousOOP on 4/12/2017.
 * Class Description:
 * Responsibilities:
 */
public class GameModel implements PhaseObserver {

    private PhaseManager phaseManager;
    private Player[] players;
    private GameMap gameMap;


    // Constructor
    public GameModel() {
        this.phaseManager = new PhaseManager(new ModelMediator(this));
        this.players = new Player[2];
        this.players[0] = new Player();
        this.players[1] = new Player();
        this.gameMap = new GameMap();
    }


    void iteratePhase(){
        //TODO implement
    }

    void save(){
        //TODO implement if you have time
    }

    void load(){
        //TODO implement if you have time
    }

    public PhaseManager getPhaseManager() {
        return phaseManager;
    }

    public void setPhaseManager(PhaseManager phaseManager) {
        this.phaseManager = phaseManager;
    }

    public Player[] getPlayers() {
        return players;
    }

    public void setPlayers(Player[] players) {
        this.players = players;
    }

    public Player getActivePlayer() {
        return players[0]; //TODO: implement
    }

    public GameMap getGameMap() {
        return gameMap;
    }

    public void setGameMap(GameMap gameMap) {
        this.gameMap = gameMap;
    }

    public void loadMapFromFilename(String filename) {
        gameMap.load(FileUtilities.loadMap(filename));
    }

    public void resetMap(){
        this.gameMap.resetMap();
    }

    public Tile[][] getMapAsGrid() {
        return gameMap.convertMapToGrid();
    }

    public void accept(PhaseNotificationVisitor v) {
        v.notifyPhase(this);<commit_msg>Broken iterator<commit_after>package model.game;

import model.map.CubeVector;
import model.map.GameMap;
import model.map.tile.Tile;
import model.phase.ModelMediator;
import model.phase.PhaseManager;
import model.phase.observers.PhaseObserver;
import model.phase.visitors.PhaseNotificationVisitor;
import model.player.Player;
import model.transporters.land_transporters.Donkey;
import model.utilities.FileUtilities;

/**
 * Created by TheNotoriousOOP on 4/12/2017.
 * Class Description:
 * Responsibilities:
 */
public class GameModel implements PhaseObserver {

    private PhaseManager phaseManager;
    private Player[] players;
    private GameMap gameMap;


    // Constructor
    public GameModel() {
        this.phaseManager = new PhaseManager(new ModelMediator(this));
        this.players = new Player[2];
        this.players[0] = new Player();
        this.players[1] = new Player();
        this.gameMap = new GameMap();
    }


    void iteratePhase(){
        //TODO implement
    }

    void save(){
        //TODO implement if you have time
    }

    void load(){
        //TODO implement if you have time
    }

    public PhaseManager getPhaseManager() {
        return phaseManager;
    }

    public void setPhaseManager(PhaseManager phaseManager) {
        this.phaseManager = phaseManager;
    }

    public Player[] getPlayers() {
        return players;
    }

    public void setPlayers(Player[] players) {
        this.players = players;
    }

    public Player getActivePlayer() {
        return players[0]; //TODO: implement
    }

    public GameMap getGameMap() {
        return gameMap;
    }

    public void setGameMap(GameMap gameMap) {
        this.gameMap = gameMap;
    }

    public void loadMapFromFilename(String filename) {
        gameMap.load(FileUtilities.loadMap(filename));
        getPlayers()[0].addTransporter(new Donkey(getPlayers()[0],
                gameMap.getTile(new CubeVector(0,0,0)).getNodeRepresentation().getParentMap().get(1).get(0)));
        getPhaseManager().endCurrentPhase();
    }

    public void resetMap(){
        this.gameMap.resetMap();
    }

    public Tile[][] getMapAsGrid() {
        return gameMap.convertMapToGrid();
    }

    public void accept(PhaseNotificationVisitor v) {
        v.notifyPhase(this);
{'fraction_non_alphanumeric': 0.1022940074906367, 'fraction_numerical': 0.006788389513108614, 'mean_word_length': 2.804986642920748, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5881148', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1193, 'n_words': 285}