Browse Source

getTrigger() now takes size_t as the index type and returns a reference to a ReadableString.

release/0.19
JustinAJ 11 years ago
parent
commit
12b67decae
  1. 4
      Jupiter/Command.cpp
  2. 2
      Jupiter/Command.h

4
Jupiter/Command.cpp

@ -52,9 +52,9 @@ void Jupiter::Command::addTrigger(const Jupiter::ReadableString &trigger)
Jupiter::Command::data_->triggers.add(new Jupiter::StringS(trigger));
}
const char *Jupiter::Command::getTrigger(short index) const
const Jupiter::ReadableString &Jupiter::Command::getTrigger(size_t index) const
{
return Jupiter::Command::data_->triggers.get(index)->c_str();
return *Jupiter::Command::data_->triggers.get(index);
}
size_t Jupiter::Command::getTriggerCount() const

2
Jupiter/Command.h

@ -49,7 +49,7 @@ namespace Jupiter
* @param index Index of the trigger to return.
* @return Trigger of the command at the specified index.
*/
const char *getTrigger(short index = 0) const;
const Jupiter::ReadableString &getTrigger(size_t index = 0) const;
/**
* @brief Returns the number of triggers accepted by the command.

Loading…
Cancel
Save