Added reasons to assertions

This commit is contained in:
2023-07-23 10:15:37 -07:00
parent 1b0218c9f3
commit a5b36fb24a
79 changed files with 359 additions and 291 deletions

View File

@ -12,7 +12,7 @@ enum TicTacToeTileState Dawn::ticTacToeDetermineWinner(
std::vector<uint8_t> *winningCombo
) {
uint8_t i;
assertNotNull(winningCombo);
assertNotNull(winningCombo, "ticTacToeDetermineWinner: winningCombo cannot be null");
// Check rows
for(i = 0; i < 9; i += 3) {

View File

@ -16,7 +16,7 @@ VNTextboxScroller::VNTextboxScroller(SceneItem *item) :
}
void VNTextboxScroller::onStart() {
assertNotNull(label);
assertNotNull(label, "VNTextboxScroller::onStart: Label cannot be null");
std::function<void()> x = [&]{
this->lineCurrent = 0;
@ -101,5 +101,4 @@ bool_t VNTextboxScroller::hasRevealedAllCharacters() {
this->lineCurrent + this->visibleLines >=
this->label->lines.size()
);
assertUnreachable();
}

View File

@ -29,8 +29,8 @@ VNEvent * VNEvent::getNextEvent() {
}
void VNEvent::next() {
assertNotNull(this->manager);
assertNotNull(this->parent);
assertNotNull(this->manager, "VNEvent::next: Manager cannot be null");
assertNotNull(this->parent, "VNEvent::next: Parent cannot be null");
this->end();
auto next = this->getNextEvent();

View File

@ -19,8 +19,8 @@ namespace Dawn {
protected:
void onStart() override {
assertNotNull(ifTrue);
assertNotNull(ifEnd);
assertNotNull(ifTrue, "VNIfEvent::onStart: ifTrue cannot be null");
assertNotNull(ifEnd, "VNIfEvent::onStart: ifEnd cannot be null");
if(this->manager->getFlag(key) == value) {
useEvent([&]{

View File

@ -18,7 +18,7 @@ namespace Dawn {
void onStart() override {
scroller = this->getScene()->findComponent<VNTextboxScroller>();
assertNotNull(scroller);
assertNotNull(scroller, "VNTextEvent::onStart: VNTextboxScroller cannot be null");
auto richText = stringReplaceAll(this->manager->defaultFont, "{{ text }}", this->text);
scroller->label->richText = richText;