<commit_before>#include "entitycomponents.h"
#include "throwassert.h"
#include <memory>

uint16_t getId(Entity entity) {
    throw_assert(entity.component<BasicInfo>(), "There is no basic info for entity " << entity.id().id());
    return entity.component<BasicInfo>()->id_;
}

std::string &getName(Entity entity) {
    throw_assert(entity.component<BasicInfo>(), "There is no basic info for entity " << entity.id().id());
    return entity.component<BasicInfo>()->name_;
}

std::shared_ptr<CMapClient> getClient(Entity entity) {
    if (!entity.component<SocketConnector>())
        return nullptr;
    return entity.component<SocketConnector>()->client_.lock();
}

bool isOnMap(Entity entity) {
    if (!entity.component<BasicInfo>())
        return false;
    return entity.component<BasicInfo>()->isOnMap_.load();
}
<commit_msg>Update entitycomponents.cpp<commit_after>#include "entitycomponents.h"
#include "throwassert.h"
#include <memory>

uint16_t getId(Entity entity) {
    throw_assert(entity.component<BasicInfo>(), "There is no basic info for entity " << entity.id().id());
    return entity.component<BasicInfo>()->id_;
}

std::string &getName(Entity entity) {
    throw_assert(entity.component<BasicInfo>(), "There is no basic info for entity " << entity.id().id());
    return entity.component<BasicInfo>()->name_;
}

std::shared_ptr<CMapClient> getClient(Entity entity) {
    if (!entity.component<SocketConnector>())
        return {};
    return entity.component<SocketConnector>()->client_.lock();
}

bool isOnMap(Entity entity) {
    if (!entity.component<BasicInfo>())
        return false;
    return entity.component<BasicInfo>()->isOnMap_.load();
}

{'fraction_non_alphanumeric': 0.15839808726838014, 'fraction_numerical': 0.002390914524805738, 'mean_word_length': 5.087272727272727, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '4726005', 'n_tokens_mistral': 500, 'n_tokens_neox': 501, 'n_words': 104}