<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mafia.server.model.state;

import com.mafia.server.model.acts.Activity;

/**
 *
 * @author Just1689
 */
public class Player {

    private String name;
    private String passKey;
    private MafiaTypes.PLAYER_ROLES role;
    private String sessionId;
    private Game game;
    private Activity activity;

    public Player(String name, String passCode, String sessionId) {
        this.name = name;
        this.passKey = passCode;
        this.role = MafiaTypes.PLAYER_ROLES.NONE;
        this.sessionId = sessionId;
    }

    public Activity getActivity() {
        return activity;
    }

    public void setActivity(Activity activity) {
        this.activity = activity;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the role
     */
    public MafiaTypes.PLAYER_ROLES getRole() {
        return role;
    }<commit_msg>Player can check if they have voted<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mafia.server.model.state;

import com.mafia.server.model.acts.Activity;

/**
 *
 * @author Just1689
 */
public class Player {

    private String name;
    private String passKey;
    private MafiaTypes.PLAYER_ROLES role;
    private String sessionId;
    private Game game;
    private Activity activity;

    public Player(String name, String passCode, String sessionId) {
        this.name = name;
        this.passKey = passCode;
        this.role = MafiaTypes.PLAYER_ROLES.NONE;
        this.sessionId = sessionId;
    }

    public boolean hasVoted() {
        if (activity == null) {
            return false;
        }
        String vote = activity.getVotes().get(this);
        return vote != null;
    }

    public Activity getActivity() {
        return activity;
    }

    public void setActivity(Activity activity) {
        this.activity = activity;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the role
     */
    public MafiaTypes.PLAYER_ROLES getRole() {
        return role;
    }
{'fraction_non_alphanumeric': 0.09195402298850575, 'fraction_numerical': 0.0029662588060808304, 'mean_word_length': 2.2234169653524494, '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': '6892002', 'n_tokens_mistral': 791, 'n_tokens_neox': 770, 'n_words': 236}