inkcpp_rb 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +1 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +84 -0
- data/LICENSE +7 -0
- data/README.md +3 -0
- data/Rakefile +16 -0
- data/bin/console +15 -0
- data/bin/setup +10 -0
- data/bin/tapioca +29 -0
- data/ext/inkcpp_rb/extconf.rb +19 -0
- data/ext/inkcpp_rb/inkcpp/.clang-format +99 -0
- data/ext/inkcpp_rb/inkcpp/.github/FUNDING.yml +1 -0
- data/ext/inkcpp_rb/inkcpp/.github/workflows/build.yml +344 -0
- data/ext/inkcpp_rb/inkcpp/.github/workflows/release.yml +49 -0
- data/ext/inkcpp_rb/inkcpp/.gitignore +25 -0
- data/ext/inkcpp_rb/inkcpp/.gitmodules +9 -0
- data/ext/inkcpp_rb/inkcpp/CMakeLists.txt +170 -0
- data/ext/inkcpp_rb/inkcpp/CODE_OF_CONDUCT.md +76 -0
- data/ext/inkcpp_rb/inkcpp/CONTRIBUTING.md +55 -0
- data/ext/inkcpp_rb/inkcpp/Config.cmake.in +2 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/cmake_example/CMakeLists.txt +13 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/cmake_example/main.c +38 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/cmake_example/main.cpp +40 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/cmake_example/test.ink +8 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/cmake_example/test.ink.json +1 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/cmake_example.zip +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/InkCPP_DEMO.zip +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/imgs/CreateThread.png +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/imgs/HandleChoice.png +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/imgs/ListElementOf.png +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/imgs/MinimalRuntime.png +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/imgs/MinimalThread.png +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/imgs/ObseverChange.png +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/imgs/TagListGetValue.png +0 -0
- data/ext/inkcpp_rb/inkcpp/Documentation/unreal/imgs/YieldResume.png +0 -0
- data/ext/inkcpp_rb/inkcpp/Doxyfile +2825 -0
- data/ext/inkcpp_rb/inkcpp/LICENSE.txt +22 -0
- data/ext/inkcpp_rb/inkcpp/Minimal.runsettings +8 -0
- data/ext/inkcpp_rb/inkcpp/README.md +192 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/CMakeLists.txt +67 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/array.h +481 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/avl_array.h +833 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/casting.h +93 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/choice.cpp +54 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/collections/restorable.cpp +124 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/collections/restorable.h +406 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/container_operations.cpp +52 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/container_operations.h +34 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/executioner.h +179 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/functional.cpp +86 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/functions.cpp +54 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/functions.h +40 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/globals_impl.cpp +289 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/globals_impl.h +149 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/header.cpp +44 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/choice.h +106 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/functional.h +327 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/globals.h +196 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/list.h +187 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/runner.h +291 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/snapshot.h +61 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/story.h +219 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/story_ptr.h +233 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/traits.h +270 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/include/types.h +169 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/list_impl.cpp +79 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/list_impl.h +39 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/list_operations.cpp +276 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/list_operations.h +356 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/list_table.cpp +841 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/list_table.h +450 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/numeric_operations.cpp +40 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/numeric_operations.h +529 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/operation_bases.h +164 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/operations.h +100 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/output.cpp +528 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/output.h +153 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/platform.h +22 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/random.h +38 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/runner_impl.cpp +1396 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/runner_impl.h +336 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/simple_restorable_stack.h +335 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/snapshot_impl.cpp +182 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/snapshot_impl.h +91 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/snapshot_interface.h +57 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/stack.cpp +618 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/stack.h +243 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/story_impl.cpp +361 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/story_impl.h +92 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/story_ptr.cpp +75 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/string_operations.cpp +125 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/string_operations.h +67 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/string_table.cpp +149 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/string_table.h +47 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/string_utils.h +207 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/system.cpp +39 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/tuple.hpp +151 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/value.cpp +279 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp/value.h +666 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/CMakeLists.txt +62 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/include/inkcpp.h +393 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/inkcpp.cpp +344 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/inkcpp_c.pc.in +10 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/tests/ExternalFunction.c +56 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/tests/Globals.c +98 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/tests/Lists.c +73 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/tests/Observer.c +36 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_c/tests/Snapshot.c +65 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_cl/CMakeLists.txt +49 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_cl/inkcpp_cl.cpp +215 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_cl/test.cpp +209 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_cl/test.h +8 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/CMakeLists.txt +37 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/binary_emitter.cpp +446 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/binary_emitter.h +70 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/binary_stream.cpp +166 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/binary_stream.h +79 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/command.cpp +107 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/compiler.cpp +96 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/emitter.cpp +62 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/emitter.h +104 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/include/compilation_results.h +22 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/include/compiler.h +44 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/json.hpp +24596 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/json_compiler.cpp +411 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/json_compiler.h +62 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/list_data.cpp +47 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/list_data.h +70 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/reporter.cpp +107 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_compiler/reporter.h +55 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/CMakeLists.txt +19 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/example.py +78 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/src/module.cpp +317 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/tests/conftest.py +53 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/tests/test_ExternalFunctions.py +35 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/tests/test_Globals.py +40 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/tests/test_Lists.py +43 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/tests/test_Observer.py +27 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/tests/test_Snapshot.py +57 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_py/unreal_example.ink +71 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Array.cpp +115 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/CMakeLists.txt +117 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Callstack.cpp +392 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/EmptyStringForDivert.cpp +36 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ExternalFunctionsExecuteProperly.cpp +34 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/FallbackFunction.cpp +77 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Globals.cpp +73 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/InkyJson.cpp +34 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/LabelCondition.cpp +60 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Lists.cpp +144 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/LookaheadSafe.cpp +46 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Main.cpp +7 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/MoveTo.cpp +95 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/NewLines.cpp +76 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/NoEarlyTags.cpp +33 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Observer.cpp +245 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Pointer.cpp +191 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Restorable.cpp +294 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/SpaceAfterBracketChoice.cpp +45 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Stack.cpp +224 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Tags.cpp +131 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ThirdTierChoiceAfterBrackets.cpp +38 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/UTF8.cpp +56 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/Value.cpp +210 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/catch.hpp +17970 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/AHF.ink +7 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/ChoiceBracketStory.ink +7 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/EmptyStringForDivert.ink +13 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/ExternalFunctionsExecuteProperly.ink +11 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/FallBack.ink +15 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/GlobalStory.ink +9 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/LabelConditionStory.ink +5 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/LinesStory.ink +42 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/ListLogicStory.ink +40 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/ListStory.ink +8 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/LookaheadSafe.ink +14 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/MoveTo.ink +36 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/NoEarlyTags.ink +19 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/ObserverStory.ink +8 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/SimpleStoryFlow.ink +65 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/TagsStory.ink +22 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/TheIntercept.ink +1686 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/ThirdTierChoiceAfterBracketsStory.ink +13 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/UTF-8-demo.txt +212 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/UTF8Story.ink +218 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/simple-1.1.1-inklecate.json +154 -0
- data/ext/inkcpp_rb/inkcpp/inkcpp_test/ink/simple-1.1.1-inky.json +160 -0
- data/ext/inkcpp_rb/inkcpp/notes/ArchitectureNotes.md +54 -0
- data/ext/inkcpp_rb/inkcpp/notes/ListNotes.md +69 -0
- data/ext/inkcpp_rb/inkcpp/notes/OperationNotes.md +35 -0
- data/ext/inkcpp_rb/inkcpp/notes/TagsNotes.md +24 -0
- data/ext/inkcpp_rb/inkcpp/notes/WhitespaceNotes.md +28 -0
- data/ext/inkcpp_rb/inkcpp/proofing/README.md +3 -0
- data/ext/inkcpp_rb/inkcpp/proofing/inkcpp_runtime_driver +12 -0
- data/ext/inkcpp_rb/inkcpp/pyproject.toml +63 -0
- data/ext/inkcpp_rb/inkcpp/setup.py +166 -0
- data/ext/inkcpp_rb/inkcpp/shared/CMakeLists.txt +14 -0
- data/ext/inkcpp_rb/inkcpp/shared/private/command.h +172 -0
- data/ext/inkcpp_rb/inkcpp/shared/private/header.h +46 -0
- data/ext/inkcpp_rb/inkcpp/shared/public/config.h +53 -0
- data/ext/inkcpp_rb/inkcpp/shared/public/system.h +307 -0
- data/ext/inkcpp_rb/inkcpp/shared/public/version.h +14 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestAllSequenceTypes.ink +59 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestArithmetic.ink +17 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestBasicStringLiterals.ink +8 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestBasicTunnel.ink +10 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestBlanksInInlineSequences.ink +51 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestCallStackEvaluation.ink +15 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestChoiceCount.ink +15 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestChoiceDivertsToDone.ink +6 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestChoiceWithBracketsOnly.ink +9 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestCompareDivertTargets.ink +26 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestComplexTunnels.ink +22 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestConditionalChoiceInWeave.ink +19 -0
- data/ext/inkcpp_rb/inkcpp/tests/TestTunnelOnwardsAfterTunnel.ink +17 -0
- data/ext/inkcpp_rb/inkcpp/unreal/CMakeLists.txt +51 -0
- data/ext/inkcpp_rb/inkcpp/unreal/UE_example.ink +92 -0
- data/ext/inkcpp_rb/inkcpp/unreal/blueprint_filter.js +377 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Resources/Icon128.png +0 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Private/InkAsset.cpp +47 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Private/InkChoice.cpp +40 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Private/InkList.cpp +86 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Private/InkRuntime.cpp +265 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Private/InkThread.cpp +239 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Private/InkVar.cpp +143 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Private/TagList.cpp +95 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Private/inkcpp.cpp +13 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/InkAsset.h +50 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/InkChoice.h +58 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/InkDelegates.h +139 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/InkList.h +102 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/InkRuntime.h +177 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/InkSnapshot.h +30 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/InkThread.h +215 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/InkVar.h +245 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/TagList.h +77 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/Public/inkcpp.h +217 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp/inkcpp.Build.cs +62 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.cpp +237 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp_editor/Private/InkAssetFactory.h +43 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp_editor/Private/inkcpp_editor.cpp +13 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp.in +24 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp_editor/Public/inkcpp_editor.h +9 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/Source/inkcpp_editor/inkcpp_editor.Build.cs +61 -0
- data/ext/inkcpp_rb/inkcpp/unreal/inkcpp/inkcpp.uplugin +44 -0
- data/ext/inkcpp_rb/inkcpp/unreal/render.css +1 -0
- data/ext/inkcpp_rb/inkcpp_rb.cpp +321 -0
- data/inkcpp_rb.gemspec +54 -0
- data/rbi/inkcpp_rb.rbi +211 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/minitest.rbi +119 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
- data/sorbet/rbi/gems/minitest@5.25.4.rbi +1547 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
- data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
- data/sorbet/rbi/gems/prism@1.3.0.rbi +40040 -0
- data/sorbet/rbi/gems/rake-compiler@1.2.8.rbi +9 -0
- data/sorbet/rbi/gems/rake@13.2.1.rbi +3033 -0
- data/sorbet/rbi/gems/rbi@0.2.2.rbi +4527 -0
- data/sorbet/rbi/gems/rice@4.3.3.rbi +44 -0
- data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
- data/sorbet/rbi/gems/tapioca@0.16.7.rbi +3611 -0
- data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
- data/sorbet/rbi/gems/yard@0.9.37.rbi +18379 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +400 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
name: Create release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- v*
|
7
|
+
|
8
|
+
permissions:
|
9
|
+
contents: write
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
release:
|
13
|
+
name: Release pushed tag
|
14
|
+
runs-on: ubuntu-22.04
|
15
|
+
environment:
|
16
|
+
name: pypi
|
17
|
+
url: https://pypi.org/p/inkcpp-py
|
18
|
+
permissions:
|
19
|
+
id-token: write
|
20
|
+
contents: write
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v4
|
23
|
+
- name: Download artifacts
|
24
|
+
env:
|
25
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
26
|
+
run: |
|
27
|
+
mkdir artifacts
|
28
|
+
ID=$(gh run list -b master --limit 1 --json databaseId | jq '.[0].databaseId')
|
29
|
+
gh run download $ID -D artifacts -n linux-cl -n linux-lib -n linux-clib -n unreal -n macos-cl -n macos-lib -n macos-clib -n macos-arm-cl -n macos-arm-lib -n macos-arm-clib -n win64-cl -n win64-lib -n win64-clib -n python-package-distribution
|
30
|
+
mv artifacts/python-package-distribution dist
|
31
|
+
- name: Zip
|
32
|
+
working-directory: ${{github.workspace}}/artifacts
|
33
|
+
run: |
|
34
|
+
for f in linux-cl linux-lib linux-clib unreal macos-cl macos-lib macos-clib macos-arm-cl macos-arm-lib macos-arm-clib win64-cl win64-lib win64-clib; do zip -r ../$f.zip $f; done
|
35
|
+
- name: List
|
36
|
+
run: tree
|
37
|
+
- name: Publish to PyPI
|
38
|
+
uses: pypa/gh-action-pypi-publish@release/v1.8
|
39
|
+
- name: Create release
|
40
|
+
env:
|
41
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
42
|
+
tag: ${{ github.ref_name }}
|
43
|
+
run: |
|
44
|
+
gh release create \
|
45
|
+
--repo="$GITHUB_REPOSITORY" \
|
46
|
+
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
|
47
|
+
--generate-notes \
|
48
|
+
"$tag" "linux-cl.zip" "linux-lib.zip" "linux-clib.zip" "unreal.zip" "macos-cl.zip" "macos-lib.zip" "macos-clib.zip" "win64-cl.zip" "macos-arm-cl.zip" "macos-arm-lib.zip" "macos-arm-clib.zip" "win64-lib.zip" "win64-clib.zip"
|
49
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Ink binary compilation
|
2
|
+
*.bin
|
3
|
+
*.tmp
|
4
|
+
|
5
|
+
# Ink files
|
6
|
+
inkcpp_cl/*.ink
|
7
|
+
*.json
|
8
|
+
!inkcpp_py/sources.json
|
9
|
+
|
10
|
+
# Visual Studio code
|
11
|
+
*.code-workspace
|
12
|
+
|
13
|
+
# Doxygen
|
14
|
+
Documentation/html/
|
15
|
+
Documentation/inkcpp_py.html
|
16
|
+
|
17
|
+
# Output
|
18
|
+
Build/*
|
19
|
+
build/*
|
20
|
+
bin/
|
21
|
+
Bin/
|
22
|
+
|
23
|
+
# Visual Studio
|
24
|
+
/out/build/
|
25
|
+
/.vs
|
@@ -0,0 +1,9 @@
|
|
1
|
+
[submodule "proofing/ink-proof"]
|
2
|
+
path = proofing/ink-proof
|
3
|
+
url = https://github.com/chromy/ink-proof.git
|
4
|
+
shallow = true
|
5
|
+
[submodule "inkcpp_py/pybind11"]
|
6
|
+
path = inkcpp_py/pybind11
|
7
|
+
url = https://github.com/pybind/pybind11.git
|
8
|
+
branch = stable
|
9
|
+
shallow = true
|
@@ -0,0 +1,170 @@
|
|
1
|
+
cmake_minimum_required(VERSION 3.16)
|
2
|
+
|
3
|
+
if(${CMAKE_VERSION} VERSION_GREATER "3.24.0")
|
4
|
+
cmake_policy(SET CMP0135 NEW)
|
5
|
+
endif()
|
6
|
+
include(FetchContent)
|
7
|
+
FetchContent_Declare(inklecate_mac
|
8
|
+
URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip
|
9
|
+
URL_HASH SHA256=c516402bca5fa249a7712e62591b048b137eba3098c53f9fb85a4253f9b9e2c0
|
10
|
+
SOURCE_DIR "inklecate/mac"
|
11
|
+
)
|
12
|
+
FetchContent_Declare(inklecate_windows
|
13
|
+
URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_windows.zip
|
14
|
+
URL_HASH SHA256=6f317cb4c59bf1b31c6dd61e80c6a2287a1d8c241a703f0586f736ae00871aab
|
15
|
+
SOURCE_DIR "inklecate/windows"
|
16
|
+
)
|
17
|
+
FetchContent_Declare(inklecate_linux
|
18
|
+
URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip
|
19
|
+
URL_HASH SHA256=26f4e188e02536d6e99e73e71d9b13e2c2144187f1368a87e82fd5066176cff8
|
20
|
+
SOURCE_DIR "inklecate/linux"
|
21
|
+
)
|
22
|
+
set(FETCHCONTENT_QUIET OFF)
|
23
|
+
set(CMAKE_TLS_VERIFY true)
|
24
|
+
# Testing enabled
|
25
|
+
enable_testing()
|
26
|
+
|
27
|
+
# Project setup
|
28
|
+
project(inkcpp VERSION 0.1.6)
|
29
|
+
SET(CMAKE_CXX_STANDARD 20)
|
30
|
+
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
31
|
+
SET(CMAKE_INSTALL_LIBRARY_DIR lib)
|
32
|
+
SET(CMAKE_INSTALL_INCLUDE_DIR include)
|
33
|
+
|
34
|
+
# Add subdirectories
|
35
|
+
set(INKCPP_PY OFF CACHE BOOL "Build python bindings")
|
36
|
+
set(WHEEL_BUILD OFF CACHE BOOL "Set for build wheel python lib (do not forgett INKCPP_PY")
|
37
|
+
set(INKCPP_C OFF CACHE BOOL "Build c library")
|
38
|
+
set(INKCPP_TEST OFF CACHE BOOL "Build inkcpp tests (requires: inklecate in path / env: INKLECATE set / INKCPP_INKLECATE=OS or ALL)")
|
39
|
+
set(INKCPP_INKLECATE "NONE" CACHE STRING "If inklecate should be downloaded automatically from the official release page. NONE -> No, OS -> Yes, but only for the current OS, ALL -> Yes, for all availible OSs")
|
40
|
+
set_property(CACHE INKCPP_INKLECATE PROPERTY STRINGS "NONE" "OS" "ALL")
|
41
|
+
set(INKCPP_DOC_BlueprintUE ON CACHE BOOL "Building doxygen documentation with BlueprintUE visualisation for unreal blueprints.")
|
42
|
+
|
43
|
+
string(TOUPPER "${INKCPP_INKLECATE}" inkcpp_inklecate_upper)
|
44
|
+
if (inkcpp_inklecate_upper STREQUAL "ALL")
|
45
|
+
FetchContent_MakeAvailable(inklecate_windows inklecate_mac inklecate_linux)
|
46
|
+
elseif(inkcpp_inklecate_upper STREQUAL "OS")
|
47
|
+
if(UNIX AND NOT APPLE)
|
48
|
+
FetchContent_MakeAvailable(inklecate_linux)
|
49
|
+
elseif(APPLE)
|
50
|
+
FetchContent_MakeAvailable(inklecate_mac)
|
51
|
+
elseif(MSYS OR MINGW OR WIN32 OR CYGWIN)
|
52
|
+
FetchContent_MakeAvailable(inklecate_windows)
|
53
|
+
else()
|
54
|
+
message(FATAL_ERROR "Unable to identify OS for option INKCPP_INKLECATE=OS, please consider using NONE or ALL.")
|
55
|
+
endif()
|
56
|
+
endif()
|
57
|
+
|
58
|
+
if (INKCPP_PY)
|
59
|
+
add_compile_options(-fPIC)
|
60
|
+
add_subdirectory(inkcpp_py)
|
61
|
+
endif(INKCPP_PY)
|
62
|
+
add_subdirectory(shared)
|
63
|
+
add_subdirectory(inkcpp)
|
64
|
+
add_subdirectory(inkcpp_compiler)
|
65
|
+
if (INKCPP_C)
|
66
|
+
add_subdirectory(inkcpp_c)
|
67
|
+
endif(INKCPP_C)
|
68
|
+
if (NOT WHEEL_BUILD)
|
69
|
+
add_subdirectory(inkcpp_cl)
|
70
|
+
if(INKCPP_TEST)
|
71
|
+
add_subdirectory(inkcpp_test)
|
72
|
+
endif(INKCPP_TEST)
|
73
|
+
add_subdirectory(unreal)
|
74
|
+
endif(NOT WHEEL_BUILD)
|
75
|
+
|
76
|
+
|
77
|
+
install(TARGETS inkcpp inkcpp_shared inkcpp_compiler
|
78
|
+
EXPORT inkcppTarget
|
79
|
+
ARCHIVE DESTINATION "lib/ink"
|
80
|
+
COMPONENT lib EXCLUDE_FROM_ALL
|
81
|
+
PUBLIC_HEADER DESTINATION "include/ink"
|
82
|
+
COMPONENT lib EXCLUDE_FROM_ALL
|
83
|
+
)
|
84
|
+
|
85
|
+
install(EXPORT inkcppTarget
|
86
|
+
FILE inkcppTargets.cmake DESTINATION "lib/cmake/inkcpp"
|
87
|
+
COMPONENT lib EXCLUDE_FROM_ALL)
|
88
|
+
|
89
|
+
include(CMakePackageConfigHelpers)
|
90
|
+
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
|
91
|
+
"${CMAKE_CURRENT_BINARY_DIR}/inkcppConfig.cmake"
|
92
|
+
INSTALL_DESTINATION "lib/cmake/inkcpp"
|
93
|
+
NO_SET_AND_CHECK_MACRO
|
94
|
+
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
|
95
|
+
write_basic_package_version_file(
|
96
|
+
"${CMAKE_CURRENT_BINARY_DIR}/inkcppConfigVersion.cmake"
|
97
|
+
VERSION "${inkcpp_VERSION_MAJOR}.${inkcpp_VERSION_MINOR}"
|
98
|
+
COMPATIBILITY AnyNewerVersion)
|
99
|
+
install(FILES
|
100
|
+
${CMAKE_CURRENT_BINARY_DIR}/inkcppConfig.cmake
|
101
|
+
${CMAKE_CURRENT_BINARY_DIR}/inkcppConfigVersion.cmake
|
102
|
+
DESTINATION lib/cmake/inkcpp COMPONENT lib EXCLUDE_FROM_ALL)
|
103
|
+
export(EXPORT inkcppTarget
|
104
|
+
FILE "${CMAKE_CURRENT_BINARY_DIR}/inkcppTargets.cmake")
|
105
|
+
|
106
|
+
# include(InstallRequiredSystemLibraries)
|
107
|
+
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
|
108
|
+
set(CPACK_PACKAGE_VERSION_MAJOR "${inkcpp_VERSION_MAJOR}")
|
109
|
+
set(CPACK_PACKAGE_VERSION_MINOR "${inkcpp_VERSION_MINOR}")
|
110
|
+
set(CPACK_SOURCE_GENERATOR "ZIP")
|
111
|
+
set(CPACK_GENERATOR "ZIP")
|
112
|
+
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
113
|
+
set(CPACK_COMPONENTS_GROUPING IGNORE)
|
114
|
+
include(CPack)
|
115
|
+
|
116
|
+
if(NOT WHEEL_BUILD)
|
117
|
+
find_package(Doxygen)
|
118
|
+
if (DOXYGEN_FOUND)
|
119
|
+
|
120
|
+
set(DOXYGEN_PROJECT_NAME ${PROJECT_NAME})
|
121
|
+
# enable if update to cmake version 3.28
|
122
|
+
# doxygen_add_docs(doc WORKING_DIR ${PROJECT_SOURCE_DIR} CONFIG_FILE "${PROJECT_SOURCE_DIR}/Doxyfile" COMMENT "Generate docs")
|
123
|
+
set(INPUT_FILTER "")
|
124
|
+
|
125
|
+
if (INKCPP_DOC_BlueprintUE)
|
126
|
+
# TODO: make as dependecy
|
127
|
+
file(COPY "${PROJECT_SOURCE_DIR}/unreal/blueprint_filter.js" DESTINATION ${PROJECT_BINARY_DIR})
|
128
|
+
# file(DOWNLOAD
|
129
|
+
# "https://raw.githubusercontent.com/blueprintue/blueprintue-self-hosted-edition/main/www/bue-render/render.css"
|
130
|
+
# "${PROJECT_BINARY_DIR}/render.css"
|
131
|
+
# EXPECTED_HASH SHA256=875364e36f8aa5d6c1d41d58043f13b48a499b5c969e8daef35bd29bbf7c6e8d)
|
132
|
+
file(COPY "${PROJECT_SOURCE_DIR}/unreal/render.css" DESTINATION ${PROJECT_BINARY_DIR})
|
133
|
+
file(APPEND "${PROJECT_BINARY_DIR}/render.css" ".bue-render .icon { background-color: unset; }")
|
134
|
+
file(READ "${PROJECT_SOURCE_DIR}/Doxyfile" DOXYFILE)
|
135
|
+
string(REPLACE "FILTER_PATTERNS =" "FILTER_PATTERNS = \"*/unreal/*=node ${PROJECT_BINARY_DIR}/blueprint_filter.js\"" DOXYFILE2 ${DOXYFILE})
|
136
|
+
string(REPLACE "HTML_EXTRA_STYLESHEET =" "HTML_EXTRA_STYLESHEET = ${PROJECT_BINARY_DIR}/render.css " DOXYFILE ${DOXYFILE2})
|
137
|
+
file(WRITE "${PROJECT_BINARY_DIR}/Doxyfile" ${DOXYFILE})
|
138
|
+
else ()
|
139
|
+
configure_file(
|
140
|
+
"${PROJECT_SOURCE_DIR}/Doxyfile"
|
141
|
+
"${PROJECT_BINARY_DIR}/Doxyfile"
|
142
|
+
COPYONLY)
|
143
|
+
endif()
|
144
|
+
|
145
|
+
add_custom_target(doc
|
146
|
+
${DOXYGEN_EXECUTABLE} "${PROJECT_BINARY_DIR}/Doxyfile"
|
147
|
+
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
148
|
+
COMMENT "Generate doxygen documentation")
|
149
|
+
set(PY_HTML "${PROJECT_SOURCE_DIR}/Documentation/inkcpp_py.html")
|
150
|
+
if (INKCPP_PY)
|
151
|
+
find_package(
|
152
|
+
Python3
|
153
|
+
REQUIRED
|
154
|
+
COMPONENTS Interpreter
|
155
|
+
)
|
156
|
+
add_custom_target(inkcpp_py_doc
|
157
|
+
python -m pydoc -w inkcpp_py
|
158
|
+
COMMAND mv "./inkcpp_py.html" ${PY_HTML}
|
159
|
+
DEPENDS inkcpp_py
|
160
|
+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inkcpp_py"
|
161
|
+
COMMENT "Generates simple python documentation")
|
162
|
+
add_dependencies(doc inkcpp_py_doc)
|
163
|
+
else()
|
164
|
+
message(WARNING "The python target is disabled, therfore no python documentation will be build. Set INKCPP_PY to change this")
|
165
|
+
file(WRITE ${PY_HTML} "<html><head></head><body><h2>Python Documenattion was not build!</h2></body></html>")
|
166
|
+
endif(INKCPP_PY)
|
167
|
+
else(DOXYGEN_FOUND)
|
168
|
+
message("Doxygen needed to generate documntation!")
|
169
|
+
endif(DOXYGEN_FOUND)
|
170
|
+
endif(NOT WHEEL_BUILD)
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at brwarner2@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
74
|
+
|
75
|
+
For answers to common questions about this code of conduct, see
|
76
|
+
https://www.contributor-covenant.org/faq
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# Contribution Guide
|
2
|
+
|
3
|
+
Want to contribute to inkcpp? Great! There's plenty to do
|
4
|
+
|
5
|
+
## What Should I Work On?
|
6
|
+
|
7
|
+
Check the project's Issues page to see if there's anything you can take care of. If not, check out the inkcpp v1 project on GitHub. Anything under "Could Use Help With" is fair game. Contact brwarner if you're unsure and need help.
|
8
|
+
|
9
|
+
# Guidelines
|
10
|
+
|
11
|
+
Here's some quick guidelines when writing code for the project.
|
12
|
+
|
13
|
+
## Code Style
|
14
|
+
|
15
|
+
Broadly, the interface style of inkcpp should resemble that of the C++ standard library.
|
16
|
+
|
17
|
+
* All type names (classes, structs, enums, typedefs, namespaces, etc.) should be written in snake_case (lowercase, words seperated by underlines).
|
18
|
+
* All enums should be C++11 "class" enums.
|
19
|
+
* Typedefs/usings to integral types should have the suffix `_t`. E.g. `hash_t` and `uint32_t`.
|
20
|
+
* When defining content in a nested namespace, use the new C++ syntax (`namespace a::b::c { ... }`) to reduce the amount of indentation
|
21
|
+
* Private class member variables should be prepended with an underscore (`_`)
|
22
|
+
* Compile-time constants should be written in PascalCase (e.g. `InvalidHash`)
|
23
|
+
|
24
|
+
## Namespaces
|
25
|
+
* Compiler code lives in the `ink::compiler` namespace
|
26
|
+
* Runtime code lives in the `ink::runtime` namespace
|
27
|
+
* Shared code lives in the `ink` namespace
|
28
|
+
* Any non-user facing code should live in the corresponding `internal` namespace.
|
29
|
+
** For example, the `restorable_array` class is never exposed outside the library, and thus lives in `ink::runtime::internal`
|
30
|
+
|
31
|
+
## Folder Structure
|
32
|
+
|
33
|
+
* Runtime code goes in the inkcpp folder
|
34
|
+
* Compiler code goes in the inkcpp_compiler folder
|
35
|
+
* Code for the inkcpp_cl executable goes in inkcpp_cl
|
36
|
+
* User facing headers should go in the corresponding `include` directory in the parent folder
|
37
|
+
* Shared headers live in `shared`, either in the `public` or `private` folder. Private is for headers that will only be used internally. Public is for user-facing headers.
|
38
|
+
|
39
|
+
## Unit Tests
|
40
|
+
|
41
|
+
Write unit tests in inkcpp_test using Catch2 whenever you create new utility types or functions, especially if you anticipate a lot of potential runtime breaking edge cases. This is especially important for the collection types which support save/restore and threading.
|
42
|
+
|
43
|
+
## (Near) Zero Heap Allocation
|
44
|
+
|
45
|
+
The inkcpp runtime should never dynamically allocate memory unless there's an emergency (stack overflow, unable to store dynamic string, etc.) The average case of the runtime should have zero heap allocations.
|
46
|
+
|
47
|
+
## C++ Standard Template Library
|
48
|
+
|
49
|
+
Any use of the C++ Standard Template Library needs to be wrapped in `#ifdef INK_ENABLE_STL`. STL should only be used to create cleaner interfaces for existing functions in inkcpp. *Inkcpp must be able to run, fully-featured, without STL.* Do not use STL in any implementations.
|
50
|
+
|
51
|
+
The only exceptions are the compiler, which uses various STL collections, and the inkcpp_cl executable code. Everything else must be wrapped.
|
52
|
+
|
53
|
+
## Unreal
|
54
|
+
|
55
|
+
Where useful, add helper functions with Unreal types to the inkcpp interface. Wrap them in `#ifdef INK_ENABLE_UNREAL`. This flag will only be set when building the Unreal plugin.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
cmake_minimum_required(VERSION 3.16)
|
2
|
+
project(main)
|
3
|
+
|
4
|
+
find_package(inkcpp CONFIG REQUIRED)
|
5
|
+
|
6
|
+
# for CXX builds
|
7
|
+
add_executable(main_cpp main.cpp)
|
8
|
+
set_property(TARGET main_cpp PROPERTY CXX_STANDARD 20)
|
9
|
+
target_link_libraries(main_cpp inkcpp inkcpp_compiler)
|
10
|
+
|
11
|
+
# for C builds
|
12
|
+
# add_executable(main_c main.c)
|
13
|
+
# target_link_libraries(main_c inkcpp_c)
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#include <stdlib.h>
|
2
|
+
#include <stdio.h>
|
3
|
+
#include <assert.h>
|
4
|
+
|
5
|
+
#include <ink/c/inkcpp.h> // if <os>-lib.zip was used for the installation
|
6
|
+
|
7
|
+
// #include <ink/inkcpp.h> // if <os>-clib.zip was used for the installation
|
8
|
+
|
9
|
+
InkValue ink_add(int argc, const InkValue argv[])
|
10
|
+
{
|
11
|
+
assert(argc == 2);
|
12
|
+
assert(argv[0].type == ValueTypeInt32 && argv[1].type == ValueTypeInt32);
|
13
|
+
return (InkValue){.type = ValueTypeInt32, .int32_v = argv[0].int32_v + argv[1].int32_v};
|
14
|
+
}
|
15
|
+
|
16
|
+
int main()
|
17
|
+
{
|
18
|
+
ink_compile_json("test.ink.json", "test.bin", NULL);
|
19
|
+
HInkStory* story = ink_story_from_file("test.bin");
|
20
|
+
HInkRunner* runner = ink_story_new_runner(story, NULL);
|
21
|
+
|
22
|
+
ink_runner_bind(runner, "my_ink_function", ink_add, 1);
|
23
|
+
|
24
|
+
while (1) {
|
25
|
+
while (ink_runner_can_continue(runner)) {
|
26
|
+
printf("%s", ink_runner_get_line(runner));
|
27
|
+
}
|
28
|
+
if (ink_runner_num_choices(runner) == 0)
|
29
|
+
break;
|
30
|
+
for (int i = 0; i < ink_runner_num_choices(runner); ++i) {
|
31
|
+
printf("%i. %s\n", i, ink_choice_text(ink_runner_get_choice(runner, i)));
|
32
|
+
}
|
33
|
+
|
34
|
+
int id;
|
35
|
+
scanf("%i", &id);
|
36
|
+
ink_runner_choose(runner, id);
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#include <ink/system.h>
|
2
|
+
#include <ink/choice.h>
|
3
|
+
#include <ink/runner.h>
|
4
|
+
#include <ink/story.h>
|
5
|
+
#include <ink/compiler.h>
|
6
|
+
|
7
|
+
#include <iostream>
|
8
|
+
|
9
|
+
using namespace ink::runtime;
|
10
|
+
|
11
|
+
int MyInkFunction(int a, int b) { return a + b; }
|
12
|
+
|
13
|
+
int main()
|
14
|
+
{
|
15
|
+
ink::compiler::run("test.ink.json", "test.bin");
|
16
|
+
// Load ink binary story, generated from the inkCPP compiler
|
17
|
+
story* myInk = story::from_file("test.bin");
|
18
|
+
|
19
|
+
// Create a new thread
|
20
|
+
runner thread = myInk->new_runner();
|
21
|
+
|
22
|
+
// Register external functions (glue automatically generated via templates)
|
23
|
+
thread->bind("my_ink_function", &MyInkFunction);
|
24
|
+
|
25
|
+
// Write to cout
|
26
|
+
while (thread->can_continue())
|
27
|
+
std::cout << thread->getline();
|
28
|
+
|
29
|
+
// Iterate choices
|
30
|
+
int id = 0;
|
31
|
+
for (const choice& c : *thread) {
|
32
|
+
std::cout << (id++) << ". " << c.text() << std::endl;
|
33
|
+
}
|
34
|
+
std::cin >> id;
|
35
|
+
thread->choose(id);
|
36
|
+
|
37
|
+
// Write to cout
|
38
|
+
while (thread->can_continue())
|
39
|
+
std::cout << thread->getline();
|
40
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"inkVersion":21,"root":[["^Hello world!","\n",["ev",{"^->":"0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-0","flg":18},{"s":["^Hello back!",{"->":"$r","var":true},null]}],["ev",{"^->":"0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":"0.c-1","flg":18},{"s":["^Bye",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":"0.2.s"},[{"#n":"$r2"}],"\n","^Nice to hear from you!","\n",{"->":"0.g-0"},{"#f":5}],"c-1":["ev",{"^->":"0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":"0.3.s"},[{"#n":"$r2"}],"\n","^BTW 3 + 5 = ","ev",3,5,{"x()":"my_ink_function","exArgs":2},"out","/ev","\n","end",{"->":"0.g-0"},{"#f":5}],"g-0":["done",null]}],"done",null],"listDefs":{}}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|