<commit_before>//
// Created by Sam on 3/7/2018.
//

#include "../../../include/Network/Derived/StartGameMessage.h"
#include "../../../include/Game/Core/Player.h"

StartGameMessage::StartGameMessage(std::shared_ptr<Player> toPlayer, std::vector<std::shared_ptr<Player>> players)
{
    std::vector<json> opponentsJSON;
    for (const auto& player : players)
    {
        if (player != toPlayer)
        {
            opponentsJSON.push_back(player->getOpponentJSON());
        }
    }

    rawJSON[TYPE_KEY] = Message::START_GAME;
    addDataMember("playerID", toPlayer->tag);
    addDataMember("opponents", opponentsJSON);
    addDataMember("hand", toPlayer->hand->getJSON());
}

StartGameMessage::~StartGameMessage()
= default;<commit_msg>Added the player state information to the active player in the startGame message.<commit_after>//
// Created by Sam on 3/7/2018.
//

#include "../../../include/Network/Derived/StartGameMessage.h"
#include "../../../include/Game/Core/Player.h"

StartGameMessage::StartGameMessage(std::shared_ptr<Player> toPlayer, std::vector<std::shared_ptr<Player>> players)
{
    std::vector<json> opponentsJSON;
    for (const auto& player : players)
    {
        if (player != toPlayer)
        {
            opponentsJSON.push_back(player->getOpponentJSON());
        }
    }

    rawJSON[TYPE_KEY] = Message::START_GAME;
    addDataMember("opponents", opponentsJSON);
    addDataMember("playerID", toPlayer->tag);
    addDataMember("hand", toPlayer->hand->getJSON());
    addDataMember("health", toPlayer->health);
    addDataMember("deckCount", toPlayer->board->deck->count());
    addDataMember("mana", toPlayer->getManaJSON());
}

StartGameMessage::~StartGameMessage()
= default;
{'fraction_non_alphanumeric': 0.1675423234092236, 'fraction_numerical': 0.0070052539404553416, 'mean_word_length': 3.855524079320113, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 24, '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': '3420245', 'n_tokens_mistral': 532, 'n_tokens_neox': 522, 'n_words': 87}