Changeset 1887 for code/trunk/src/core/input/Button.h
- Timestamp:
- Oct 6, 2008, 12:31:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/input/Button.h
r1755 r1887 40 40 #include <string> 41 41 #include <vector> 42 #include "InputCommands.h" 42 43 43 44 namespace orxonox … … 46 47 { 47 48 public: 48 Button() { nCommands_[0]=0; nCommands_[1]=0; nCommands_[2]=0; clear(); }49 Button(); 49 50 virtual ~Button() { clear(); } 50 51 virtual void clear(); 51 52 virtual bool addParamCommand(ParamCommand* command) { return false; } 52 void parse(std::vector<BufferedParamCommand*>& paramCommandBuffer); 53 void parse(); 54 void readConfigValue(); 53 55 bool execute(KeybindMode::Enum mode, float abs = 1.0f, float rel = 1.0f); 54 56 57 //! Container to allow for better configValue support 58 ConfigValueContainer* configContainer_; 55 59 //! The configured string value 56 60 std::string bindingString_; 57 61 //! Name of the trigger as strings 58 62 std::string name_; 63 //! Name of the group of input triggers 64 std::string groupName_; 59 65 //! Basic commands for OnPress, OnHold and OnRelease 60 66 BaseCommand** commands_[3]; … … 64 70 //! Note: This variable is here to have only one parse() function. 65 71 float buttonThreshold_; 72 bool bButtonThresholdUser_; 73 //! Pointer to the list of parametrised commands 74 std::vector<BufferedParamCommand*>* paramCommandBuffer_; 66 75 67 76 private: 68 77 void parseError(std::string message, bool serious); 69 78 }; 79 80 inline bool Button::execute(KeybindMode::Enum mode, float abs, float rel) 81 { 82 // execute all the parsed commands in the string 83 for (unsigned int iCommand = 0; iCommand < nCommands_[mode]; iCommand++) 84 commands_[mode][iCommand]->execute(abs, rel); 85 return true; 86 } 87 70 88 } 71 89
Note: See TracChangeset
for help on using the changeset viewer.