Beispiel #1
0
/**
*	This is called when a text event is deleted.
*/
void EventSystem::textEventDeleted(QString ID) {
	for (int i = 0; i < _textEvents.size(); i++) {
		TextEvent *it = _textEvents.at(i);
		if (it->getName() == ID)
			_textEvents.remove(i);
	}
}
Beispiel #2
0
/**
*	Get text event with specified name.
*/
TextEvent* EventSystem::getTextEvent(QString ID) const {
	if (ID == QString())
		throw ProjectException("Cannot search for a text event with an empty ID.");

	for (int i = 0; i < _textEvents.size(); i++) {
		TextEvent *it = _textEvents.at(i);
		if (!!it && (it->getName() == ID))
			return it;
	}

	return 0;
}
Beispiel #3
0
/**
*	Remove text event with name <i>name</i> from the system.
*/
void EventSystem::removeTextEvent(QString name) {
	if (name == QString())
		throw ProjectException("Cannot search for a text event with an empty name.");

	for (int i = 0; i < _textEvents.size(); i++) {
		TextEvent *it = _textEvents.at(i);
		if (!!it && (it->getName() == name)) {
			_textEvents.remove(i);
			delete it;
			return;
		}
	}
}