diff --git a/test.cpp b/test.cpp index de22ea4..0d9bd2a 100644 --- a/test.cpp +++ b/test.cpp @@ -1,16 +1,37 @@ #include "fluent++.hpp" +template +using Callback = std::function; + +void CastSpell(int id, Callback const& callback) +{ + std::cout << "Cast " << id << std::endl; + + // on success call true + callback(true); +} + +void MoveTo(int point, Callback const& callback) +{ + std::cout << "Move to point " << point << std::endl; + + // on success call true + callback(true); +} + int main(int argc, char** argv) { - make_waterfall() - .then([] + make_waterfall>() + .then(std::bind(&CastSpell, 71382, std::placeholders::_1)) + .then([](bool success, Callback const& callback) { - + MoveTo(1, callback); }) - .then([] + .then([](bool success) { - + // Do something final + std::cout << "finish everything" << std::endl; }); return 0;