Progress on poker logic

This commit is contained in:
2022-11-20 22:18:50 -08:00
parent 4eeecced2f
commit 5762f12841
31 changed files with 1779 additions and 222 deletions

View File

@ -66,13 +66,12 @@ IVisualNovelEvent * IVisualNovelEvent::end() {
if(this->doNext != nullptr) {
auto next = this->doNext;
this->doNext = nullptr;
return next;
}
}
IVisualNovelEvent::~IVisualNovelEvent() {
if(this->doNext != nullptr) {
if(!this->hasStarted && this->doNext != nullptr) {
delete this->doNext;
}
}

View File

@ -67,12 +67,15 @@ namespace Dawn {
virtual void onEnd() = 0;
public:
IVisualNovelEvent *previous = nullptr;
IVisualNovelEvent(VisualNovelManager *manager);
template<class T>
T * then(T *next) {
assertNotNull(next);
this->doNext = next;
next->previous = this;
return next;
}

View File

@ -43,7 +43,6 @@ void VisualNovelTextbox::show() {
if(this->isVisible()) return;
this->visible = true;
this->addChild(&this->selfParent);
std::cout << "Showing" << std::endl;
}
void VisualNovelTextbox::hide() {
@ -114,13 +113,13 @@ void VisualNovelTextbox::textboxOnSceneUpdate() {
return;
}
auto lastTimeCharacter = (int32_t)mathFloorFloat(this->timeCharacter);
auto lastTimeCharacter = mathFloor<int32_t>(this->timeCharacter);
if(game->inputManager.isDown(INPUT_BIND_ACCEPT)) {
this->timeCharacter += game->timeManager.delta * VISUAL_NOVEL_TEXTBOX_SPEED_FASTER;
} else {
this->timeCharacter += game->timeManager.delta * VISUAL_NOVEL_TEXTBOX_SPEED;
}
auto newTimeCharacter = (int32_t)mathFloorFloat(this->timeCharacter);
auto newTimeCharacter = mathFloor<int32_t>(this->timeCharacter);
if(newTimeCharacter == lastTimeCharacter) return;
this->label.quadCount = newTimeCharacter;
@ -187,7 +186,7 @@ bool_t VisualNovelTextbox::hasRevealedAllCurrentCharacters() {
) {
quadsTotal += this->label.measure.getQuadsOnLine(i);
}
return mathFloorFloat(this->timeCharacter) >= quadsTotal;
return mathFloor<int32_t>(this->timeCharacter) >= quadsTotal;
}
bool_t VisualNovelTextbox::hasRevealedAllCharacters() {