6e71aeebb4
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
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
// for now juist CLI, print an arr, then print each it
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include <SFML/Graphics/Color.hpp>
|
|
#include <SFML/Graphics/Font.hpp>
|
|
#include <SFML/Graphics/RenderWindow.hpp>
|
|
#include <SFML/Graphics/Text.hpp>
|
|
#include <SFML/Window/Window.hpp>
|
|
#include <SFML/Window.hpp>
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
#include "core/app.hpp"
|
|
#include "sessions.hpp"
|
|
#include "sorters.hpp"
|
|
|
|
using namespace std::chrono;
|
|
using namespace std;
|
|
|
|
|
|
vector<int> dataprovider(){
|
|
return vector<int> {9,8,1,2,7,3,6,4,5};
|
|
}
|
|
|
|
int main() {
|
|
//create data
|
|
vector<shared_ptr<SortInput>> inputs;
|
|
auto myinput = make_shared<SortInput>("arr1", dataprovider());
|
|
auto myinput2 = make_shared<SortInput>("arr2", dataprovider());
|
|
|
|
inputs.push_back(myinput);
|
|
inputs.push_back(myinput2);
|
|
|
|
//connect data with sorter
|
|
auto myssession = make_unique<SortSession>();
|
|
myssession->add_session(myinput, "bsort");
|
|
|
|
auto myviewsession = make_unique<ViewSession>();
|
|
|
|
//create app with initialized dependencies
|
|
App myapp(std::move(inputs), std::move(myssession), std::move(myviewsession));
|
|
myapp.run();
|
|
}
|