ScriptCanvasGraphUtilities.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Script/ScriptSystemBus.h>
  10. #include <Editor/Framework/ScriptCanvasTraceUtilities.h>
  11. #include <Editor/Framework/ScriptCanvasReporter.h>
  12. #include <ScriptCanvas/Assets/ScriptCanvasFileHandling.h>
  13. #include <ScriptCanvas/Core/Core.h>
  14. #include <ScriptCanvas/Translation/TranslationResult.h>
  15. namespace ScriptCanvas
  16. {
  17. class RuntimeAsset;
  18. class RuntimeComponent;
  19. }
  20. namespace ScriptCanvasEditor
  21. {
  22. struct LoadedInterpretedDependency
  23. {
  24. AZStd::string path;
  25. AZ::Data::Asset<ScriptCanvas::RuntimeAsset> runtimeAsset;
  26. ScriptCanvas::Translation::LuaAssetResult luaAssetResult;
  27. AZStd::vector<LoadedInterpretedDependency> dependencies;
  28. };
  29. AZ_INLINE AZStd::vector<LoadedInterpretedDependency> LoadInterpretedDepencies(const ScriptCanvas::DependencySet& dependencySet);
  30. AZ_INLINE LoadTestGraphResult LoadTestGraph(AZStd::string_view path);
  31. struct RunSpec
  32. {
  33. DurationSpec duration;
  34. ScriptCanvas::ExecutionMode execution = ScriptCanvas::ExecutionMode::Interpreted;
  35. bool expectRuntimeFailure = false;;
  36. bool processOnly = false;
  37. bool release = true;
  38. bool debug = true;
  39. bool traced = true;
  40. AZStd::function<void()> m_onPostSimulate;
  41. };
  42. struct RunGraphSpec
  43. {
  44. AZStd::string_view graphPath;
  45. AZStd::string_view dirPath;
  46. RunSpec runSpec;
  47. };
  48. AZ_INLINE Reporters RunGraph(const RunGraphSpec& runGraphSpec);
  49. AZ_INLINE void RunEditorAsset(AZ::Data::Asset<AZ::Data::AssetData> asset, Reporter& reporter, ScriptCanvas::ExecutionMode mode);
  50. AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, Reporter& reporter);
  51. AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, LoadTestGraphResult& loadGraphResult, Reporter& reporter);
  52. AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, Reporters& reporters);
  53. AZ_INLINE void Simulate(const DurationSpec& duration);
  54. AZ_INLINE void SimulateDuration(const DurationSpec& duration);
  55. AZ_INLINE void SimulateSeconds(const DurationSpec& duration);
  56. AZ_INLINE void SimulateTicks(const DurationSpec& duration);
  57. } // ScriptCanvasEditor
  58. #include <Editor/Framework/ScriptCanvasGraphUtilities.inl>