/* * InputDefintion.h * * Created on: 5 déc. 2020 * Author: fanch */ #ifndef SRC_INPUTDEFINTION_H_ #define SRC_INPUTDEFINTION_H_ #include "utils.h" #include "AbsInput.h" /** * @brief Classe qui représente un type d'input défini dans le JSON. Il permet d'instancier et de * configurer les boutons et controllers. */ class InputDefinition { public: InputDefinition(){} InputDefinition(const std::string& name, Json::Value& v){ m_name=name; Json::Value root = v["actions"]; for( Json::Value::const_iterator itr = root.begin() ; itr != root.end() ; itr++ ) { std::string k = itr.key().asString(); Json::Value v = *itr; m_actions.push_back(new InputActionList(k, new InputAction("", v))); } std::string t = v["type"].asString(); if(t=="BUTTON") m_type=BUTTON; if(t=="CONTROLLER") m_type=CONTROLLER; } virtual ~InputDefinition(){ int s = m_actions.size(); for(int i=0; i m_actions; friend class PadDefinition; }; #endif /* SRC_INPUTDEFINTION_H_ */