<commit_before>#include <Bindings/Bindings.hpp>
#include <Bindings/InputBindings.hpp>
#include <Input/InputActionEvent.hpp>
#include <Input/InputButton.hpp>
#include <Input/InputManager.hpp>
#include <Input/KeyList.hpp>
#include <Types/Identifiable.hpp>

#include <kaguya/kaguya.hpp>

namespace obe::Bindings::InputBindings
{
    void LoadInputAction(kaguya::State* lua)
    {
        Load(lua, "obe.Identifiable");
        (*lua)["obe"]["InputAction"].setClass(
            kaguya::UserdataMetatable<Input::InputAction, Types::Identifiable>()
                .addFunction("addCondition", &Input::InputAction::addCondition)
                .addFunction("addContext", &Input::InputAction::addContext)
                .addFunction("check", &Input::InputAction::check)
                .addFunction("connect", &Input::InputAction::connect)
                .addFunction("getContexts", &Input::InputAction::getContexts)
                .addFunction("getInterval", &Input::InputAction::getInterval)
                .addFunction("getRepeat", &Input::InputAction::getRepeat)
                .addFunction("setInterval", &Input::InputAction::setInterval)
                .addFunction("setRepeat", &Input::InputAction::setRepeat)
                .addFunction("update", &Input::InputAction::update));
    }

    void LoadInputActionEvent(kaguya::State* lua)
    {
        (*lua)["obe"]["InputActionEvent"].setClass(
            kaguya::UserdataMetatable<Input::InputActionEvent>()
                .addFunction("getAction", &Input::InputActionEvent::getAction)
                .addFunction("getCondition",
                             &Input::InputActionEvent::getCondition));
    }

    void LoadInputButton(kaguya::State* lua)
    {
        (*lua)["obe"]["InputButton"].setClass(
            kaguya::UserdataMetatable<Input::InputButton>()
                .addFunction("getKey", &Input::InputButton::getKey)
                .addFunction("getName", &Input::InputButton::getName)
                .addFunction("getType", &Input::InputButton::getType)
                .addFunction("is", &Input::InputButton::is)
                .addFunction("isPressed", &Input::InputButton::isPressed)
                .addFunction("isWritable", &Input::InputButton::isWritable));
    }

    void LoadInputButtonMonitor(kaguya::State* lua)
    {
        (*lua)["obe"]["InputButtonMonitor"].setClass(
            kaguya::UserdataMetatable<Input::InputButtonMonitor>()
                .addFunction("getButton", &Input::InputButtonMonitor::getButton)
                .addFunction("getState", &Input::InputButtonMonitor::getState)
                .addFunction("update", &Input::InputButtonMonitor::update));

        /*(*lua)["obe"]["InputButtonMonitorPtr"].setClass(kaguya::UserdataMetatable<Input::InputButtonMonitorPtr>()
        );*/
    }

    void LoadInputCondition(kaguya::State* lua)
    {
        (*lua)["obe"]["InputCondition"].setClass(
            kaguya::UserdataMetatable<Input::InputCondition>()
                .addFunction("addCombinationElement",
                             &Input::InputCondition::addCombinationElement)
                .addFunction("check", &Input::InputCondition::check)
                .addFunction("setCombination",
                             &Input::InputCondition::setCombination)
                .addFunction("setCombinationCode",
                             &Input::InputCondition::setCombinationCode));
    }

    void LoadInputManager(kaguya::State* lua)
    {
        (*lua)["obe"]["InputManager"].setClass(
            kaguya::UserdataMetatable<Input::InputManager>()
                .addFunction("actionExists", &Input::InputManager::actionExists)
                .addFunction("clear", &Input::InputManager::clear)
                .addFunction("clearContexts",
                             &Input::InputManager::clearContexts)
                .addFunction("configure", &Input::InputManager::configure)
                .addFunction("getAction", &Input::InputManager::getAction)
                .addFunction("setContext", &Input::InputManager::setContext)
                .addFunction("setEnabled", &Input::InputManager::setEnabled)
                .addFunction("update", &Input::InputManager::update));

        (*lua)["obe"]["InputManager"]["addContext"] = kaguya::function(
            [](Input::InputManager& manager, const std::string& context) {
                return &manager.addContext(context);
            });<commit_msg>Fixed Lua Bindings<commit_after>#include <Bindings/Bindings.hpp>
#include <Bindings/InputBindings.hpp>
#include <Input/InputActionEvent.hpp>
#include <Input/InputButton.hpp>
#include <Input/InputManager.hpp>
#include <Input/KeyList.hpp>
#include <Types/Identifiable.hpp>

#include <kaguya/kaguya.hpp>

namespace obe::Bindings::InputBindings
{
    void LoadInputAction(kaguya::State* lua)
    {
        Load(lua, "obe.Identifiable");
        (*lua)["obe"]["InputAction"].setClass(
            kaguya::UserdataMetatable<Input::InputAction, Types::Identifiable>()
                .addFunction("addCondition", &Input::InputAction::addCondition)
                .addFunction("addContext", &Input::InputAction::addContext)
                .addFunction("check", &Input::InputAction::check)
                .addFunction("connect", &Input::InputAction::connect)
                .addFunction("getContexts", &Input::InputAction::getContexts)
                .addFunction("getInterval", &Input::InputAction::getInterval)
                .addFunction("getRepeat", &Input::InputAction::getRepeat)
                .addFunction("setInterval", &Input::InputAction::setInterval)
                .addFunction("setRepeat", &Input::InputAction::setRepeat)
                .addFunction("update", &Input::InputAction::update));
    }

    void LoadInputActionEvent(kaguya::State* lua)
    {
        (*lua)["obe"]["InputActionEvent"].setClass(
            kaguya::UserdataMetatable<Input::InputActionEvent>()
                .addFunction("getAction", &Input::InputActionEvent::getAction)
                .addFunction("getCondition",
                             &Input::InputActionEvent::getCondition));
    }

    void LoadInputButton(kaguya::State* lua)
    {
        (*lua)["obe"]["InputButton"].setClass(
            kaguya::UserdataMetatable<Input::InputButton>()
                .addFunction("getKey", &Input::InputButton::getKey)
                .addFunction("getName", &Input::InputButton::getName)
                .addFunction("getType", &Input::InputButton::getType)
                .addFunction("is", &Input::InputButton::is)
                .addFunction("isPressed", &Input::InputButton::isPressed)
                .addFunction("isWritable", &Input::InputButton::isWritable));
    }

    void LoadInputButtonMonitor(kaguya::State* lua)
    {
        (*lua)["obe"]["InputButtonMonitor"].setClass(
            kaguya::UserdataMetatable<Input::InputButtonMonitor>()
                .addFunction("getButton", &Input::InputButtonMonitor::getButton)
                .addFunction("getState", &Input::InputButtonMonitor::getState)
                .addFunction("update", &Input::InputButtonMonitor::update));

        /*(*lua)["obe"]["InputButtonMonitorPtr"].setClass(kaguya::UserdataMetatable<Input::InputButtonMonitorPtr>()
        );*/
    }

    void LoadInputCondition(kaguya::State* lua)
    {
        (*lua)["obe"]["InputCondition"].setClass(
            kaguya::UserdataMetatable<Input::InputCondition>()
                .addFunction("addCombinationElement",
                             &Input::InputCondition::addCombinationElement)
                .addFunction("check", &Input::InputCondition::check)
                .addFunction("setCombination",
                             &Input::InputCondition::setCombination)
                .addFunction("setCombinationCode",
                             &Input::InputCondition::setCombinationCode));
    }

    void LoadInputManager(kaguya::State* lua)
    {
        Load(lua, "obe.Togglable");
        (*lua)["obe"]["InputManager"].setClass(
            kaguya::UserdataMetatable<Input::InputManager, Types::Togglable>()
                .addFunction("actionExists", &Input::InputManager::actionExists)
                .addFunction("clear", &Input::InputManager::clear)
                .addFunction("clearContexts",
                             &Input::InputManager::clearContexts)
                .addFunction("configure", &Input::InputManager::configure)
                .addFunction("getAction", &Input::InputManager::getAction)
                .addFunction("setContext", &Input::InputManager::setContext)
                .addFunction("update", &Input::InputManager::update));

        (*lua)["obe"]["InputManager"]["addContext"] = kaguya::function(
            [](Input::InputManager& manager, const std::string& context) {
                return &manager.addContext(context);
            });
{'fraction_non_alphanumeric': 0.14995493465525012, 'fraction_numerical': 0.0, 'mean_word_length': 2.886602451838879, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '5546002', 'n_tokens_mistral': 2422, 'n_tokens_neox': 2344, 'n_words': 257}