<commit_before><?php

namespace UniEngine\Engine\Includes\Helpers\Users;

function getUsersTechLevel($techID, $user) {
    global $_Vars_GameElements;

    $userTechKey = $_Vars_GameElements[$techID];

    return $user[$userTechKey];
}

function getUsersEngineSpeedTechModifier($engineTechID, $user) {
    global $_Vars_TechSpeedModifiers;

    $engineTechSpeedModifier = $_Vars_TechSpeedModifiers[$engineTechID];
    $userTechLevel = getUsersTechLevel($engineTechID, $user);

    return (1 + ($engineTechSpeedModifier * $userTechLevel));
}

function getMaxStructuresQueueLength(&$user) {
    return (
        isPro($user) ?
        MAX_BUILDING_QUEUE_SIZE_PRO :
        MAX_BUILDING_QUEUE_SIZE
    );
}

?>
<commit_msg>GH-63 Add a helper function determining user's research queue max length<commit_after><?php

namespace UniEngine\Engine\Includes\Helpers\Users;

function getUsersTechLevel($techID, $user) {
    global $_Vars_GameElements;

    $userTechKey = $_Vars_GameElements[$techID];

    return $user[$userTechKey];
}

function getUsersEngineSpeedTechModifier($engineTechID, $user) {
    global $_Vars_TechSpeedModifiers;

    $engineTechSpeedModifier = $_Vars_TechSpeedModifiers[$engineTechID];
    $userTechLevel = getUsersTechLevel($engineTechID, $user);

    return (1 + ($engineTechSpeedModifier * $userTechLevel));
}

function getMaxStructuresQueueLength(&$user) {
    return (
        isPro($user) ?
        MAX_BUILDING_QUEUE_SIZE_PRO :
        MAX_BUILDING_QUEUE_SIZE
    );
}

function getMaxResearchQueueLength($user) {
    return (
        isPro($user) ?
        MAX_TECH_QUEUE_LENGTH_PRO :
        MAX_TECH_QUEUE_LENGTH
    );
}

?>

{'fraction_non_alphanumeric': 0.10574018126888217, 'fraction_numerical': 0.002416918429003021, 'mean_word_length': 4.538461538461538, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3729749', 'n_tokens_mistral': 558, 'n_tokens_neox': 531, 'n_words': 80}