<commit_before>package com.theyavikteam.monsterboard.model.domain;

import com.theyavikteam.monsterboard.model.constants.GameConstants;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class GameDomain {
    private PlayerDomain playerO;
    private PlayerDomain playerX;
    private int turn;
    private boolean movementMade;
    private String lastPlayerSymbol;
    private int columnSize;
    private int rowSize;
    private List<CellDomain> cells;
    private List<CellDomain> aroundCells;

    public GameDomain(PlayerDomain playerO, PlayerDomain playerX, int columnSize, int rowSize) {
        this.playerO = playerO;
        this.playerX = playerX;
        movementMade = false;
        turn = new Random().nextInt(1);
        this.columnSize = columnSize;
        this.rowSize = rowSize;
        this.cells = initializeCells();
    }

    private List<CellDomain> initializeCells() {
        List<CellDomain> cellDomains = new ArrayList<>();
        for (int i = 0; i < (columnSize * rowSize); i++) {
            cellDomains.add(new CellDomain(i, Double.valueOf(Math.floor(i / columnSize)).intValue() + 1, (i % rowSize) + 1));
        }
        return cellDomains;
    }

    public List<CellDomain> getCells() {
        return cells;
    }

    public PlayerDomain getPlayerO() {
        return playerO;
    }

    public PlayerDomain getPlayerX() {
        return playerX;
    }

    public int getTurn() {
        return turn;
    }

    public PlayerDomain getCurrentPlayer() {
        if (turn == 0) {
            return playerO;
        } else {
            return playerX;
        }
    }

    public PlayerDomain getOtherPlayer() {
        if (turn == 0) {
            return playerX;
        } else {
            return playerO;
        }
    }

    public String getLastPlayerSymbol() {
        return lastPlayerSymbol;
    }

    public void changeTurn() {
        if (this.turn == 0) {
            this.turn = 1;
        } else {
            this.turn = 0;
        }
        movementMade = false;
    }

    public boolean isMovementMade() {
        return movementMade;
    }

    public void makeMove() {
        movementMade = true;
        lastPlayerSymbol = getCurrentPlayer().getPlayerSymbol();
    }

    public void updateScore(int cellIndex) {
        PlayerDomain currentPlayer = getCurrentPlayer();
        int newScore = currentPlayer.getScore() + 1;
        cells.get(cellIndex).setPlayer(currentPlayer);
        newScore += getLinealScore(currentPlayer, cellIndex);
        newScore += getDiagonalScore(currentPlayer, cellIndex);
        currentPlayer.setScore(newScore);
    }

    private int getLinealScore(PlayerDomain currentPlayer, int cellIndex) {
        return getScore(currentPlayer, cellIndex, GameConstants.OWN_LINEAL_CELL_SCORE, GameConstants.RIVAL_LINEAL_CELL_SCORE, true);
    }

    private List<CellDomain> getLinealCells(int cellIndex) {
        refreshAroundCells();
        addIfMajorThan(cellIndex - rowSize);
        addIfMajorThan(cellIndex - 1);
        addIfMinorThan(cellIndex + 1);
        addIfMinorThan(cellIndex + rowSize);
        return aroundCells;
    }


    private int getDiagonalScore(PlayerDomain currentPlayer, int cellIndex) {<commit_msg>Game Domain Removes<commit_after>package com.theyavikteam.monsterboard.model.domain;

import com.theyavikteam.monsterboard.model.constants.GameConstants;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class GameDomain {
    private PlayerDomain playerO;
    private PlayerDomain playerX;
    private int turn;
    private boolean movementMade;
    private String lastPlayerSymbol;
    private int columnSize;
    private int rowSize;
    private List<CellDomain> cells;
    private List<CellDomain> aroundCells;

    public GameDomain(PlayerDomain playerO, PlayerDomain playerX, int columnSize, int rowSize) {
        this.playerO = playerO;
        this.playerX = playerX;
        movementMade = false;
        turn = new Random().nextInt(1);
        this.columnSize = columnSize;
        this.rowSize = rowSize;
        this.cells = initializeCells();
    }

    private List<CellDomain> initializeCells() {
        List<CellDomain> cellDomains = new ArrayList<>();
        for (int i = 0; i < (columnSize * rowSize); i++) {
            cellDomains.add(new CellDomain(i, Double.valueOf(Math.floor(i / columnSize)).intValue() + 1, (i % rowSize) + 1));
        }
        return cellDomains;
    }

    public List<CellDomain> getCells() {
        return cells;
    }

    public PlayerDomain getPlayerO() {
        return playerO;
    }

    public PlayerDomain getPlayerX() {
        return playerX;
    }

    public PlayerDomain getCurrentPlayer() {
        if (turn == 0) {
            return playerO;
        } else {
            return playerX;
        }
    }

    public PlayerDomain getOtherPlayer() {
        if (turn == 0) {
            return playerX;
        } else {
            return playerO;
        }
    }

    public String getLastPlayerSymbol() {
        return lastPlayerSymbol;
    }

    public void changeTurn() {
        if (this.turn == 0) {
            this.turn = 1;
        } else {
            this.turn = 0;
        }
        movementMade = false;
    }

    public boolean isMovementMade() {
        return movementMade;
    }

    public void makeMove() {
        movementMade = true;
        lastPlayerSymbol = getCurrentPlayer().getPlayerSymbol();
    }

    public void updateScore(int cellIndex) {
        PlayerDomain currentPlayer = getCurrentPlayer();
        int newScore = currentPlayer.getScore() + GameConstants.SIMPLE_SCORE;
        cells.get(cellIndex).setPlayer(currentPlayer);
        newScore += getLinealScore(currentPlayer, cellIndex);
        newScore += getDiagonalScore(currentPlayer, cellIndex);
        currentPlayer.setScore(newScore);
    }

    private int getLinealScore(PlayerDomain currentPlayer, int cellIndex) {
        return getScore(currentPlayer, cellIndex, GameConstants.OWN_LINEAL_CELL_SCORE, GameConstants.RIVAL_LINEAL_CELL_SCORE, true);
    }

    private List<CellDomain> getLinealCells(int cellIndex) {
        refreshAroundCells();
        addIfMajorThan(cellIndex - rowSize);
        addIfMajorThan(cellIndex - 1);
        addIfMinorThan(cellIndex + 1);
        addIfMinorThan(cellIndex + rowSize);
        return aroundCells;
    }


    private int getDiagonalScore(PlayerDomain currentPlayer, int cellIndex) {
{'fraction_non_alphanumeric': 0.09078276980083372, 'fraction_numerical': 0.003551026709896557, 'mean_word_length': 2.5302452316076294, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, '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': '1893160', 'n_tokens_mistral': 1880, 'n_tokens_neox': 1797, 'n_words': 423}