app now just coordinates the components initialized in main

reduced responsibilities of constructors
started using more pointers.
sessions through app rather than app itself.
mostly split view away from app (still hard coded)
haven't decoupled sorts from timers as their actuator yet
This commit is contained in:
2026-08-15 03:04:32 +02:00
parent afdf73ca2e
commit 6e71aeebb4
9 changed files with 123 additions and 98 deletions
+7 -6
View File
@@ -1,29 +1,30 @@
#include <cstdio>
#include <memory>
#include <utility>
#include "sorters.hpp"
using namespace std;
SteppedBsort::SteppedBsort(SortInput &input): data(input) {};
SteppedBsort::SteppedBsort(shared_ptr<SortInput> input): data(input) {};
bool SteppedBsort:: step(){
if(is_finished==true) {
printf("finished");
return true;
}
if(data.values[j]>data.values[j+1])
if(data->values[j]>data->values[j+1])
{
swap(data.values[j], data.values[j+1]);
swap(data->values[j], data->values[j+1]);
}
j++;
if(j>=data.values.size()-1 -i){
if(j>=data->values.size()-1 -i){
j=0;
i++;
}
if (i==data.values.size()-1){
if (i==data->values.size()-1){
is_finished=true;
}
return false;
}