Added reasons to assertions

This commit is contained in:
2023-07-23 10:15:37 -07:00
parent ef6b269141
commit 5b01eb904d
78 changed files with 357 additions and 289 deletions

View File

@ -32,7 +32,7 @@ namespace Dawn {
* @param callback Callback method that invokes back.
*/
EventListener(T *instance, void (T::*callback)(A... args)) {
assertNotNull(instance);
assertNotNull(instance, "EventListener::EventListener: Instance cannot be null");
this->instance = instance;
this->callback = callback;
@ -64,10 +64,10 @@ namespace Dawn {
T *instance,
void (T::*callback)(A... args)
) {
assertNotNull(instance);
assertNotNull(instance, "Event::addListener: Instance cannot be null");
auto listener = new EventListener<T,A...>(instance, callback);
assertNotNull(listener);
assertNotNull(listener, "Event::addListener: Listener could not be created (Memory filled?)");
this->listeners.push_back(listener);
return listener;
}