Research portable Memory game | Исследовать портируемую игру Память
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

ctx_test2.cpp 887B

5 ay önce
123456789101112131415161718192021222324252627282930313233343536
  1. #include <string>
  2. #include "ctx.h"
  3. #include "memory_Context.h"
  4. std::string ctx_test_Controller_executeFunctions_set() {
  5. auto c = memory_createContext();
  6. ctx_Controller<memory_Context> ctrl(c);
  7. /*
  8. // Disable automatic invocation of executeFunctions.
  9. ctrl.isProcessingQueue = true;
  10. ctrl.set("input", "123");
  11. auto processInput = [](const memory_Context &c) -> memory_Context {
  12. if (c.recentField == "input") {
  13. c.outputHelp = "Checked";
  14. c.recentField = "outputHelp";
  15. return c;
  16. }
  17. c.recentField = "none";
  18. return c;
  19. };
  20. ctrl.registerFunction(processInput);
  21. // Apply 'input'.
  22. ctrl.executeFunctions();
  23. // Apply 'outputHelp'.
  24. ctrl.executeFunctions();
  25. if (
  26. c.input == "123" &&
  27. c.outputHelp == "Checked"
  28. ) {
  29. return "OK: ctx_Controller_executeFunctions_set";
  30. }
  31. */
  32. return "ERR: ctx_Controller_executeFunctions_set";
  33. }