Created
October 21, 2019 08:35
-
-
Save neugen86/2dfb7431aa59ba3ab020476c4b0abd65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainCommand; | |
class MainSucceededCommand; | |
class MainFailedCommand; | |
class MyControllerWithStartMethod | |
{ | |
public: | |
void start() | |
{ | |
CommandBuilder<MainCommand> builder; | |
builder.onSucceeded([this]{ onFistSucceeded(); }); | |
builder.onFailed([this]{ onFirstFailed(); }); | |
Command cmd = builder.build(); | |
cmd.execute(); | |
} | |
private: | |
void onFirstSucceded() | |
{ | |
CommandBuilder<MainSucceededCommand> builder; | |
builder.onSucceeded([] | |
{ | |
}); | |
builder.onFailed({ | |
}); | |
Command cmd = builder.build(); | |
cmd.execute(); | |
} | |
void onFirstFailed() | |
{ | |
CommandBuilder<MainFailedCommand> builder; | |
builder.onSucceeded([] | |
{ | |
}); | |
builder.onFailed({ | |
}); | |
Command cmd = builder.build(); | |
cmd.execute(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment