<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.bus.ent;

import com.mafia.server.model.state.Game;
import com.mafia.server.model.state.Player;
import com.mafia.server.model.state.Repository;
import javax.websocket.Session;

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

    public static void playerQuits(Session session) {
        Player player = Repository.getPlayerBySession(session);
        player.getGame().removePlayer(player);

        //Todo: notify?
    }

    public static void joinGame(Player player, Game game) {
        player.setGame(game);
    }

}<commit_msg>Cleanup<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.bus.ent;

import com.mafia.server.bus.notify.GameNotify;
import com.mafia.server.model.state.Game;
import com.mafia.server.model.state.Player;
import com.mafia.server.model.state.Repository;
import javax.websocket.Session;

/**
 *
 * @author Just1689
 */
public class PlayerEvents {
    
    public static void playerQuits(Session session) {
        Player player = Repository.getPlayerBySession(session);
        player.getGame().removePlayer(player);

        //Todo: notify?
    }
    
    public static void joinGame(Player player, Game game) {
        player.setGame(game);
        game.addPlayer(player);
        GameNotify.sendGameState(game);
    }
    
}
{'fraction_non_alphanumeric': 0.10463018641010223, 'fraction_numerical': 0.004810583283223091, 'mean_word_length': 3.3789473684210525, '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': '6024207', 'n_tokens_mistral': 500, 'n_tokens_neox': 488, 'n_words': 126}