Full Code of utopia-rise/godot-kotlin for AI

master 8d51f614df62 cached
934 files
3.9 MB
1.1M tokens
1 requests
Download .txt
Showing preview only (4,353K chars total). Download the full file or copy to clipboard to get everything.
Repository: utopia-rise/godot-kotlin
Branch: master
Commit: 8d51f614df62
Files: 934
Total size: 3.9 MB

Directory structure:
gitextract_19j7ugkt/

├── .editorconfig
├── .gitattributes
├── .github/
│   ├── CODEOWNERS
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   ├── bin/
│   │   └── check-repo-is-clean.sh
│   └── workflows/
│       ├── CI.yaml
│       ├── check-pr-annotation-processor.yaml
│       ├── check-pr-build-props.yaml
│       ├── check-pr-codegen-uptodate.yaml
│       ├── check-pr-compiler-native-plugin.yaml
│       ├── check-pr-compiler-plugin-common.yaml
│       ├── check-pr-compiler-plugin.yaml
│       ├── check-pr-core.yaml
│       ├── check-pr-entry-generator.yaml
│       ├── check-pr-gradle-plugin.yaml
│       ├── check-pr-samples-3d-platformer.yaml
│       └── check-pr-samples-mini-games.yaml
├── .gitignore
├── .gitmodules
├── .readthedocs.yml
├── LICENSE
├── README.md
├── build.gradle.kts
├── buildSrc/
│   ├── build.gradle.kts
│   └── src/
│       └── main/
│           └── kotlin/
│               ├── BintrayPublish.kt
│               ├── DependenciesVersions.kt
│               ├── godot/
│               │   ├── codegen/
│               │   │   ├── Argument.kt
│               │   │   ├── Class.kt
│               │   │   ├── Enum.kt
│               │   │   ├── Graph.kt
│               │   │   ├── ICall.kt
│               │   │   ├── Method.kt
│               │   │   ├── Property.kt
│               │   │   ├── Signal.kt
│               │   │   ├── SignalArgument.kt
│               │   │   ├── TypeCast.kt
│               │   │   └── generationEntry.kt
│               │   └── tasks/
│               │       └── GenerateApiTask.kt
│               └── os.kt
├── design-docs/
│   ├── ABOUT.md
│   └── dictionary.md
├── docs/
│   ├── .gitignore
│   ├── SUMMARY.md
│   ├── build.sh
│   ├── mkdocs.yml
│   ├── requirements.txt
│   ├── run.sh
│   └── src/
│       └── doc/
│           ├── api-differences.md
│           ├── contribution.md
│           ├── index.md
│           ├── setup/
│           │   ├── gradle.md
│           │   └── ide.md
│           ├── supported-platforms.md
│           └── user-guide/
│               ├── classes.md
│               ├── methods.md
│               ├── properties.md
│               └── signals.md
├── entry-generation/
│   ├── godot-annotation-processor/
│   │   ├── build.gradle.kts
│   │   └── src/
│   │       └── main/
│   │           └── kotlin/
│   │               └── godot/
│   │                   └── annotation/
│   │                       └── processor/
│   │                           └── GodotAnnotationProcessor.kt
│   ├── godot-compiler-native-plugin/
│   │   ├── build.gradle.kts
│   │   └── src/
│   │       └── main/
│   │           ├── kotlin/
│   │           │   └── godot/
│   │           │       └── compiler/
│   │           │           └── plugin/
│   │           │               └── NativeComponentRegistrar.kt
│   │           └── resources/
│   │               └── META-INF/
│   │                   └── services/
│   │                       ├── org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
│   │                       └── org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
│   ├── godot-compiler-plugin/
│   │   ├── build.gradle.kts
│   │   └── src/
│   │       └── main/
│   │           ├── kotlin/
│   │           │   └── godot/
│   │           │       └── compiler/
│   │           │           └── plugin/
│   │           │               └── CommonComponentRegistrar.kt
│   │           └── resources/
│   │               └── META-INF/
│   │                   └── services/
│   │                       ├── org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
│   │                       └── org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
│   ├── godot-compiler-plugin-common/
│   │   ├── build.gradle.kts
│   │   └── src/
│   │       └── main/
│   │           └── kotlin/
│   │               └── godot/
│   │                   └── compiler/
│   │                       └── plugin/
│   │                           └── CompilerPluginConst.kt
│   └── godot-entry-generator/
│       ├── build.gradle.kts
│       └── src/
│           └── main/
│               └── kotlin/
│                   └── godot/
│                       └── entrygenerator/
│                           ├── EntryGenerator.kt
│                           ├── exceptions/
│                           │   └── WrongAnnotationUsageException.kt
│                           ├── extension/
│                           │   ├── AnnotationExt.kt
│                           │   ├── ClassDescriptorExt.kt
│                           │   ├── KotlinTypeExt.kt
│                           │   ├── PropertyDescriptorExt.kt
│                           │   └── StringExt.kt
│                           ├── filebuilder/
│                           │   └── EntryFileBuilder.kt
│                           ├── generator/
│                           │   ├── ClassRegistrationGenerator.kt
│                           │   ├── FunctionRegistrationGenerator.kt
│                           │   ├── GdnsGenerator.kt
│                           │   ├── PropertyRegistrationGenerator.kt
│                           │   ├── SignalRegistrationGenerator.kt
│                           │   └── provider/
│                           │       ├── ArrayRegistrationValuesHandler.kt
│                           │       ├── CoreTypeRegistrationValuesHandler.kt
│                           │       ├── DefaultValueHandlerProvider.kt
│                           │       ├── EnumFlagRegistrationValuesHandler.kt
│                           │       ├── EnumRegistrationValuesHandler.kt
│                           │       ├── IntFlagRegistrationValuesHandler.kt
│                           │       ├── MultiLineTextRegistrationValuesHandler.kt
│                           │       ├── PlaceholderTextRegistrationValuesHandler.kt
│                           │       ├── PrimitiveRegistrationValuesHandler.kt
│                           │       ├── RegistrationValuesHandler.kt
│                           │       └── ResourceRegistrationValuesHandler.kt
│                           ├── mapper/
│                           │   ├── PropertyHintTypeMapper.kt
│                           │   ├── RpcModeAnnotationMapper.kt
│                           │   └── TypeToVariantAsClassNameMapper.kt
│                           ├── model/
│                           │   ├── Annotations.kt
│                           │   └── ClassWithMembers.kt
│                           └── transformer/
│                               └── TypeDeclarationsToClassWithMemberTransformer.kt
├── godot-kotlin/
│   └── godot-library/
│       ├── build.gradle.kts
│       └── src/
│           ├── nativeCore/
│           │   └── kotlin/
│           │       └── godot/
│           │           └── core/
│           │               ├── ClassHandle.kt
│           │               ├── ClassRegistry.kt
│           │               ├── Godot.kt
│           │               ├── IndexedIterator.kt
│           │               ├── MethodBindCache.kt
│           │               ├── TypeManager.kt
│           │               ├── Wrapper.kt
│           │               ├── bridge.kt
│           │               ├── caseConverterExt.kt
│           │               ├── classBuilderDsl.kt
│           │               ├── functions.kt
│           │               ├── properties.kt
│           │               ├── signalProviders.kt
│           │               ├── signals.kt
│           │               ├── type/
│           │               │   ├── AABB.kt
│           │               │   ├── Basis.kt
│           │               │   ├── Color.kt
│           │               │   ├── Dictionary.kt
│           │               │   ├── GdString.kt
│           │               │   ├── GodotArray.kt
│           │               │   ├── NodePath.kt
│           │               │   ├── Plane.kt
│           │               │   ├── Quat.kt
│           │               │   ├── RID.kt
│           │               │   ├── Rect2.kt
│           │               │   ├── Transform.kt
│           │               │   ├── Transform2D.kt
│           │               │   ├── Variant.kt
│           │               │   ├── Vector2.kt
│           │               │   ├── Vector3.kt
│           │               │   ├── array/
│           │               │   │   ├── EnumArray.kt
│           │               │   │   ├── ObjectArray.kt
│           │               │   │   ├── VariantArray.kt
│           │               │   │   ├── core/
│           │               │   │   │   ├── AABBArray.kt
│           │               │   │   │   ├── BasisArray.kt
│           │               │   │   │   ├── ColorArray.kt
│           │               │   │   │   ├── CoreArray.kt
│           │               │   │   │   ├── NodePathArray.kt
│           │               │   │   │   ├── PlaneArray.kt
│           │               │   │   │   ├── QuatArray.kt
│           │               │   │   │   ├── RIDArray.kt
│           │               │   │   │   ├── Rect2Array.kt
│           │               │   │   │   ├── Transform2DArray.kt
│           │               │   │   │   ├── TransformArray.kt
│           │               │   │   │   ├── Vector2Array.kt
│           │               │   │   │   └── Vector3Array.kt
│           │               │   │   └── primitive/
│           │               │   │       ├── BoolVariantArray.kt
│           │               │   │       ├── IntVariantArray.kt
│           │               │   │       ├── RealVariantArray.kt
│           │               │   │       └── StringVariantArray.kt
│           │               │   ├── pool/
│           │               │   │   ├── PoolByteArray.kt
│           │               │   │   ├── PoolColorArray.kt
│           │               │   │   ├── PoolIntArray.kt
│           │               │   │   ├── PoolRealArray.kt
│           │               │   │   ├── PoolStringArray.kt
│           │               │   │   ├── PoolVector2Array.kt
│           │               │   │   └── PoolVector3Array.kt
│           │               │   └── string/
│           │               │       ├── File.kt
│           │               │       ├── Hash.kt
│           │               │       ├── UnEscape.kt
│           │               │       ├── Util.kt
│           │               │       └── Validation.kt
│           │               ├── typealias.kt
│           │               └── variantTypeMapping.kt
│           ├── nativeGen/
│           │   └── kotlin/
│           │       └── godot/
│           │           ├── ARVRAnchor.kt
│           │           ├── ARVRCamera.kt
│           │           ├── ARVRController.kt
│           │           ├── ARVRInterface.kt
│           │           ├── ARVRInterfaceGDNative.kt
│           │           ├── ARVROrigin.kt
│           │           ├── ARVRPositionalTracker.kt
│           │           ├── ARVRServer.kt
│           │           ├── AStar.kt
│           │           ├── AStar2D.kt
│           │           ├── AcceptDialog.kt
│           │           ├── AnimatedSprite.kt
│           │           ├── AnimatedSprite3D.kt
│           │           ├── AnimatedTexture.kt
│           │           ├── Animation.kt
│           │           ├── AnimationNode.kt
│           │           ├── AnimationNodeAdd2.kt
│           │           ├── AnimationNodeAdd3.kt
│           │           ├── AnimationNodeAnimation.kt
│           │           ├── AnimationNodeBlend2.kt
│           │           ├── AnimationNodeBlend3.kt
│           │           ├── AnimationNodeBlendSpace1D.kt
│           │           ├── AnimationNodeBlendSpace2D.kt
│           │           ├── AnimationNodeBlendTree.kt
│           │           ├── AnimationNodeOneShot.kt
│           │           ├── AnimationNodeOutput.kt
│           │           ├── AnimationNodeStateMachine.kt
│           │           ├── AnimationNodeStateMachinePlayback.kt
│           │           ├── AnimationNodeStateMachineTransition.kt
│           │           ├── AnimationNodeTimeScale.kt
│           │           ├── AnimationNodeTimeSeek.kt
│           │           ├── AnimationNodeTransition.kt
│           │           ├── AnimationPlayer.kt
│           │           ├── AnimationRootNode.kt
│           │           ├── AnimationTrackEditPlugin.kt
│           │           ├── AnimationTree.kt
│           │           ├── AnimationTreePlayer.kt
│           │           ├── Area.kt
│           │           ├── Area2D.kt
│           │           ├── ArrayMesh.kt
│           │           ├── AtlasTexture.kt
│           │           ├── AudioBusLayout.kt
│           │           ├── AudioEffect.kt
│           │           ├── AudioEffectAmplify.kt
│           │           ├── AudioEffectBandLimitFilter.kt
│           │           ├── AudioEffectBandPassFilter.kt
│           │           ├── AudioEffectChorus.kt
│           │           ├── AudioEffectCompressor.kt
│           │           ├── AudioEffectDelay.kt
│           │           ├── AudioEffectDistortion.kt
│           │           ├── AudioEffectEQ.kt
│           │           ├── AudioEffectEQ10.kt
│           │           ├── AudioEffectEQ21.kt
│           │           ├── AudioEffectEQ6.kt
│           │           ├── AudioEffectFilter.kt
│           │           ├── AudioEffectHighPassFilter.kt
│           │           ├── AudioEffectHighShelfFilter.kt
│           │           ├── AudioEffectInstance.kt
│           │           ├── AudioEffectLimiter.kt
│           │           ├── AudioEffectLowPassFilter.kt
│           │           ├── AudioEffectLowShelfFilter.kt
│           │           ├── AudioEffectNotchFilter.kt
│           │           ├── AudioEffectPanner.kt
│           │           ├── AudioEffectPhaser.kt
│           │           ├── AudioEffectPitchShift.kt
│           │           ├── AudioEffectRecord.kt
│           │           ├── AudioEffectReverb.kt
│           │           ├── AudioEffectSpectrumAnalyzer.kt
│           │           ├── AudioEffectSpectrumAnalyzerInstance.kt
│           │           ├── AudioEffectStereoEnhance.kt
│           │           ├── AudioServer.kt
│           │           ├── AudioStream.kt
│           │           ├── AudioStreamGenerator.kt
│           │           ├── AudioStreamGeneratorPlayback.kt
│           │           ├── AudioStreamMicrophone.kt
│           │           ├── AudioStreamOGGVorbis.kt
│           │           ├── AudioStreamPlayback.kt
│           │           ├── AudioStreamPlaybackResampled.kt
│           │           ├── AudioStreamPlayer.kt
│           │           ├── AudioStreamPlayer2D.kt
│           │           ├── AudioStreamPlayer3D.kt
│           │           ├── AudioStreamRandomPitch.kt
│           │           ├── AudioStreamSample.kt
│           │           ├── BackBufferCopy.kt
│           │           ├── BakedLightmap.kt
│           │           ├── BakedLightmapData.kt
│           │           ├── BaseButton.kt
│           │           ├── BitMap.kt
│           │           ├── BitmapFont.kt
│           │           ├── Bone2D.kt
│           │           ├── BoneAttachment.kt
│           │           ├── BoxContainer.kt
│           │           ├── BoxShape.kt
│           │           ├── BulletPhysicsDirectBodyState.kt
│           │           ├── Button.kt
│           │           ├── ButtonGroup.kt
│           │           ├── CPUParticles.kt
│           │           ├── CPUParticles2D.kt
│           │           ├── CSGBox.kt
│           │           ├── CSGCombiner.kt
│           │           ├── CSGCylinder.kt
│           │           ├── CSGMesh.kt
│           │           ├── CSGPolygon.kt
│           │           ├── CSGPrimitive.kt
│           │           ├── CSGShape.kt
│           │           ├── CSGSphere.kt
│           │           ├── CSGTorus.kt
│           │           ├── Camera.kt
│           │           ├── Camera2D.kt
│           │           ├── CameraFeed.kt
│           │           ├── CameraServer.kt
│           │           ├── CameraTexture.kt
│           │           ├── CanvasItem.kt
│           │           ├── CanvasItemMaterial.kt
│           │           ├── CanvasLayer.kt
│           │           ├── CanvasModulate.kt
│           │           ├── CapsuleMesh.kt
│           │           ├── CapsuleShape.kt
│           │           ├── CapsuleShape2D.kt
│           │           ├── CenterContainer.kt
│           │           ├── CharFXTransform.kt
│           │           ├── CheckBox.kt
│           │           ├── CheckButton.kt
│           │           ├── CircleShape2D.kt
│           │           ├── ClassDB.kt
│           │           ├── ClippedCamera.kt
│           │           ├── CollisionObject.kt
│           │           ├── CollisionObject2D.kt
│           │           ├── CollisionPolygon.kt
│           │           ├── CollisionPolygon2D.kt
│           │           ├── CollisionShape.kt
│           │           ├── CollisionShape2D.kt
│           │           ├── ColorPicker.kt
│           │           ├── ColorPickerButton.kt
│           │           ├── ColorRect.kt
│           │           ├── ConcavePolygonShape.kt
│           │           ├── ConcavePolygonShape2D.kt
│           │           ├── ConeTwistJoint.kt
│           │           ├── ConfigFile.kt
│           │           ├── ConfirmationDialog.kt
│           │           ├── Container.kt
│           │           ├── Control.kt
│           │           ├── ConvexPolygonShape.kt
│           │           ├── ConvexPolygonShape2D.kt
│           │           ├── Crypto.kt
│           │           ├── CryptoKey.kt
│           │           ├── CubeMap.kt
│           │           ├── CubeMesh.kt
│           │           ├── Curve.kt
│           │           ├── Curve2D.kt
│           │           ├── Curve3D.kt
│           │           ├── CurveTexture.kt
│           │           ├── CylinderMesh.kt
│           │           ├── CylinderShape.kt
│           │           ├── DTLSServer.kt
│           │           ├── DampedSpringJoint2D.kt
│           │           ├── DirectionalLight.kt
│           │           ├── Directory.kt
│           │           ├── DynamicFont.kt
│           │           ├── DynamicFontData.kt
│           │           ├── EditorExportPlugin.kt
│           │           ├── EditorFeatureProfile.kt
│           │           ├── EditorFileDialog.kt
│           │           ├── EditorFileSystem.kt
│           │           ├── EditorFileSystemDirectory.kt
│           │           ├── EditorImportPlugin.kt
│           │           ├── EditorInspector.kt
│           │           ├── EditorInspectorPlugin.kt
│           │           ├── EditorInterface.kt
│           │           ├── EditorNavigationMeshGenerator.kt
│           │           ├── EditorPlugin.kt
│           │           ├── EditorProperty.kt
│           │           ├── EditorResourceConversionPlugin.kt
│           │           ├── EditorResourcePreview.kt
│           │           ├── EditorResourcePreviewGenerator.kt
│           │           ├── EditorSceneImporter.kt
│           │           ├── EditorSceneImporterAssimp.kt
│           │           ├── EditorScenePostImport.kt
│           │           ├── EditorScript.kt
│           │           ├── EditorSelection.kt
│           │           ├── EditorSettings.kt
│           │           ├── EditorSpatialGizmo.kt
│           │           ├── EditorSpatialGizmoPlugin.kt
│           │           ├── EditorSpinSlider.kt
│           │           ├── EditorVCSInterface.kt
│           │           ├── EncodedObjectAsID.kt
│           │           ├── Engine.kt
│           │           ├── Environment.kt
│           │           ├── Expression.kt
│           │           ├── ExternalTexture.kt
│           │           ├── File.kt
│           │           ├── FileDialog.kt
│           │           ├── FileSystemDock.kt
│           │           ├── Font.kt
│           │           ├── FuncRef.kt
│           │           ├── GDNative.kt
│           │           ├── GDNativeLibrary.kt
│           │           ├── GDScript.kt
│           │           ├── GDScriptFunctionState.kt
│           │           ├── GIProbe.kt
│           │           ├── GIProbeData.kt
│           │           ├── Generic6DOFJoint.kt
│           │           ├── Geometry.kt
│           │           ├── GeometryInstance.kt
│           │           ├── GlobalConstants.kt
│           │           ├── Gradient.kt
│           │           ├── GradientTexture.kt
│           │           ├── GraphEdit.kt
│           │           ├── GraphNode.kt
│           │           ├── GridContainer.kt
│           │           ├── GridMap.kt
│           │           ├── GrooveJoint2D.kt
│           │           ├── HBoxContainer.kt
│           │           ├── HScrollBar.kt
│           │           ├── HSeparator.kt
│           │           ├── HSlider.kt
│           │           ├── HSplitContainer.kt
│           │           ├── HTTPClient.kt
│           │           ├── HTTPRequest.kt
│           │           ├── HashingContext.kt
│           │           ├── HeightMapShape.kt
│           │           ├── HingeJoint.kt
│           │           ├── IP.kt
│           │           ├── Image.kt
│           │           ├── ImageTexture.kt
│           │           ├── ImmediateGeometry.kt
│           │           ├── Input.kt
│           │           ├── InputEvent.kt
│           │           ├── InputEventAction.kt
│           │           ├── InputEventGesture.kt
│           │           ├── InputEventJoypadButton.kt
│           │           ├── InputEventJoypadMotion.kt
│           │           ├── InputEventKey.kt
│           │           ├── InputEventMIDI.kt
│           │           ├── InputEventMagnifyGesture.kt
│           │           ├── InputEventMouse.kt
│           │           ├── InputEventMouseButton.kt
│           │           ├── InputEventMouseMotion.kt
│           │           ├── InputEventPanGesture.kt
│           │           ├── InputEventScreenDrag.kt
│           │           ├── InputEventScreenTouch.kt
│           │           ├── InputEventWithModifiers.kt
│           │           ├── InputMap.kt
│           │           ├── InstancePlaceholder.kt
│           │           ├── InterpolatedCamera.kt
│           │           ├── ItemList.kt
│           │           ├── JNISingleton.kt
│           │           ├── JSON.kt
│           │           ├── JSONParseResult.kt
│           │           ├── JSONRPC.kt
│           │           ├── JavaClass.kt
│           │           ├── JavaClassWrapper.kt
│           │           ├── JavaScript.kt
│           │           ├── Joint.kt
│           │           ├── Joint2D.kt
│           │           ├── KinematicBody.kt
│           │           ├── KinematicBody2D.kt
│           │           ├── KinematicCollision.kt
│           │           ├── KinematicCollision2D.kt
│           │           ├── Label.kt
│           │           ├── LargeTexture.kt
│           │           ├── Light.kt
│           │           ├── Light2D.kt
│           │           ├── LightOccluder2D.kt
│           │           ├── Line2D.kt
│           │           ├── LineEdit.kt
│           │           ├── LineShape2D.kt
│           │           ├── LinkButton.kt
│           │           ├── Listener.kt
│           │           ├── MainLoop.kt
│           │           ├── MarginContainer.kt
│           │           ├── Marshalls.kt
│           │           ├── Material.kt
│           │           ├── MenuButton.kt
│           │           ├── Mesh.kt
│           │           ├── MeshDataTool.kt
│           │           ├── MeshInstance.kt
│           │           ├── MeshInstance2D.kt
│           │           ├── MeshLibrary.kt
│           │           ├── MeshTexture.kt
│           │           ├── MobileVRInterface.kt
│           │           ├── MultiMesh.kt
│           │           ├── MultiMeshInstance.kt
│           │           ├── MultiMeshInstance2D.kt
│           │           ├── MultiplayerAPI.kt
│           │           ├── MultiplayerPeerGDNative.kt
│           │           ├── Mutex.kt
│           │           ├── NativeScript.kt
│           │           ├── Navigation.kt
│           │           ├── Navigation2D.kt
│           │           ├── NavigationMesh.kt
│           │           ├── NavigationMeshInstance.kt
│           │           ├── NavigationPolygon.kt
│           │           ├── NavigationPolygonInstance.kt
│           │           ├── NetworkedMultiplayerENet.kt
│           │           ├── NetworkedMultiplayerPeer.kt
│           │           ├── NinePatchRect.kt
│           │           ├── Node.kt
│           │           ├── Node2D.kt
│           │           ├── NoiseTexture.kt
│           │           ├── OS.kt
│           │           ├── Object.kt
│           │           ├── OccluderPolygon2D.kt
│           │           ├── OmniLight.kt
│           │           ├── OpenSimplexNoise.kt
│           │           ├── OptionButton.kt
│           │           ├── PCKPacker.kt
│           │           ├── PHashTranslation.kt
│           │           ├── PackedDataContainer.kt
│           │           ├── PackedDataContainerRef.kt
│           │           ├── PackedScene.kt
│           │           ├── PacketPeer.kt
│           │           ├── PacketPeerDTLS.kt
│           │           ├── PacketPeerGDNative.kt
│           │           ├── PacketPeerStream.kt
│           │           ├── PacketPeerUDP.kt
│           │           ├── Panel.kt
│           │           ├── PanelContainer.kt
│           │           ├── PanoramaSky.kt
│           │           ├── ParallaxBackground.kt
│           │           ├── ParallaxLayer.kt
│           │           ├── Particles.kt
│           │           ├── Particles2D.kt
│           │           ├── ParticlesMaterial.kt
│           │           ├── Path.kt
│           │           ├── Path2D.kt
│           │           ├── PathFollow.kt
│           │           ├── PathFollow2D.kt
│           │           ├── Performance.kt
│           │           ├── PhysicalBone.kt
│           │           ├── Physics2DDirectBodyState.kt
│           │           ├── Physics2DDirectBodyStateSW.kt
│           │           ├── Physics2DDirectSpaceState.kt
│           │           ├── Physics2DServer.kt
│           │           ├── Physics2DShapeQueryParameters.kt
│           │           ├── Physics2DShapeQueryResult.kt
│           │           ├── Physics2DTestMotionResult.kt
│           │           ├── PhysicsBody.kt
│           │           ├── PhysicsBody2D.kt
│           │           ├── PhysicsDirectBodyState.kt
│           │           ├── PhysicsDirectSpaceState.kt
│           │           ├── PhysicsMaterial.kt
│           │           ├── PhysicsServer.kt
│           │           ├── PhysicsShapeQueryParameters.kt
│           │           ├── PhysicsShapeQueryResult.kt
│           │           ├── PinJoint.kt
│           │           ├── PinJoint2D.kt
│           │           ├── PlaneMesh.kt
│           │           ├── PlaneShape.kt
│           │           ├── PluginScript.kt
│           │           ├── PointMesh.kt
│           │           ├── Polygon2D.kt
│           │           ├── PolygonPathFinder.kt
│           │           ├── Popup.kt
│           │           ├── PopupDialog.kt
│           │           ├── PopupMenu.kt
│           │           ├── PopupPanel.kt
│           │           ├── Position2D.kt
│           │           ├── Position3D.kt
│           │           ├── PrimitiveMesh.kt
│           │           ├── PrismMesh.kt
│           │           ├── ProceduralSky.kt
│           │           ├── ProgressBar.kt
│           │           ├── ProjectSettings.kt
│           │           ├── ProximityGroup.kt
│           │           ├── ProxyTexture.kt
│           │           ├── QuadMesh.kt
│           │           ├── RandomNumberGenerator.kt
│           │           ├── Range.kt
│           │           ├── RayCast.kt
│           │           ├── RayCast2D.kt
│           │           ├── RayShape.kt
│           │           ├── RayShape2D.kt
│           │           ├── RectangleShape2D.kt
│           │           ├── Reference.kt
│           │           ├── ReferenceRect.kt
│           │           ├── ReflectionProbe.kt
│           │           ├── RegEx.kt
│           │           ├── RegExMatch.kt
│           │           ├── RemoteTransform.kt
│           │           ├── RemoteTransform2D.kt
│           │           ├── Resource.kt
│           │           ├── ResourceFormatLoader.kt
│           │           ├── ResourceFormatSaver.kt
│           │           ├── ResourceImporter.kt
│           │           ├── ResourceInteractiveLoader.kt
│           │           ├── ResourceLoader.kt
│           │           ├── ResourcePreloader.kt
│           │           ├── ResourceSaver.kt
│           │           ├── RichTextEffect.kt
│           │           ├── RichTextLabel.kt
│           │           ├── RigidBody.kt
│           │           ├── RigidBody2D.kt
│           │           ├── RootMotionView.kt
│           │           ├── SceneState.kt
│           │           ├── SceneTree.kt
│           │           ├── SceneTreeTimer.kt
│           │           ├── Script.kt
│           │           ├── ScriptCreateDialog.kt
│           │           ├── ScriptEditor.kt
│           │           ├── ScrollBar.kt
│           │           ├── ScrollContainer.kt
│           │           ├── SegmentShape2D.kt
│           │           ├── Semaphore.kt
│           │           ├── Separator.kt
│           │           ├── Shader.kt
│           │           ├── ShaderMaterial.kt
│           │           ├── Shape.kt
│           │           ├── Shape2D.kt
│           │           ├── ShortCut.kt
│           │           ├── Skeleton.kt
│           │           ├── Skeleton2D.kt
│           │           ├── SkeletonIK.kt
│           │           ├── Skin.kt
│           │           ├── SkinReference.kt
│           │           ├── Sky.kt
│           │           ├── Slider.kt
│           │           ├── SliderJoint.kt
│           │           ├── SoftBody.kt
│           │           ├── Spatial.kt
│           │           ├── SpatialGizmo.kt
│           │           ├── SpatialMaterial.kt
│           │           ├── SpatialVelocityTracker.kt
│           │           ├── SphereMesh.kt
│           │           ├── SphereShape.kt
│           │           ├── SpinBox.kt
│           │           ├── SplitContainer.kt
│           │           ├── SpotLight.kt
│           │           ├── SpringArm.kt
│           │           ├── Sprite.kt
│           │           ├── Sprite3D.kt
│           │           ├── SpriteBase3D.kt
│           │           ├── SpriteFrames.kt
│           │           ├── StaticBody.kt
│           │           ├── StaticBody2D.kt
│           │           ├── StreamPeer.kt
│           │           ├── StreamPeerBuffer.kt
│           │           ├── StreamPeerGDNative.kt
│           │           ├── StreamPeerSSL.kt
│           │           ├── StreamPeerTCP.kt
│           │           ├── StreamTexture.kt
│           │           ├── StyleBox.kt
│           │           ├── StyleBoxEmpty.kt
│           │           ├── StyleBoxFlat.kt
│           │           ├── StyleBoxLine.kt
│           │           ├── StyleBoxTexture.kt
│           │           ├── SurfaceTool.kt
│           │           ├── TCP_Server.kt
│           │           ├── TabContainer.kt
│           │           ├── Tabs.kt
│           │           ├── TextEdit.kt
│           │           ├── TextFile.kt
│           │           ├── Texture.kt
│           │           ├── Texture3D.kt
│           │           ├── TextureArray.kt
│           │           ├── TextureButton.kt
│           │           ├── TextureLayered.kt
│           │           ├── TextureProgress.kt
│           │           ├── TextureRect.kt
│           │           ├── Theme.kt
│           │           ├── Thread.kt
│           │           ├── TileMap.kt
│           │           ├── TileSet.kt
│           │           ├── Timer.kt
│           │           ├── ToolButton.kt
│           │           ├── TouchScreenButton.kt
│           │           ├── Translation.kt
│           │           ├── TranslationServer.kt
│           │           ├── Tree.kt
│           │           ├── TreeItem.kt
│           │           ├── TriangleMesh.kt
│           │           ├── Tween.kt
│           │           ├── UDPServer.kt
│           │           ├── UPNP.kt
│           │           ├── UPNPDevice.kt
│           │           ├── UndoRedo.kt
│           │           ├── VBoxContainer.kt
│           │           ├── VScrollBar.kt
│           │           ├── VSeparator.kt
│           │           ├── VSlider.kt
│           │           ├── VSplitContainer.kt
│           │           ├── VehicleBody.kt
│           │           ├── VehicleWheel.kt
│           │           ├── VideoPlayer.kt
│           │           ├── VideoStream.kt
│           │           ├── VideoStreamGDNative.kt
│           │           ├── VideoStreamTheora.kt
│           │           ├── VideoStreamWebm.kt
│           │           ├── Viewport.kt
│           │           ├── ViewportContainer.kt
│           │           ├── ViewportTexture.kt
│           │           ├── VisibilityEnabler.kt
│           │           ├── VisibilityEnabler2D.kt
│           │           ├── VisibilityNotifier.kt
│           │           ├── VisibilityNotifier2D.kt
│           │           ├── VisualInstance.kt
│           │           ├── VisualScript.kt
│           │           ├── VisualScriptBasicTypeConstant.kt
│           │           ├── VisualScriptBuiltinFunc.kt
│           │           ├── VisualScriptClassConstant.kt
│           │           ├── VisualScriptComment.kt
│           │           ├── VisualScriptComposeArray.kt
│           │           ├── VisualScriptCondition.kt
│           │           ├── VisualScriptConstant.kt
│           │           ├── VisualScriptConstructor.kt
│           │           ├── VisualScriptCustomNode.kt
│           │           ├── VisualScriptDeconstruct.kt
│           │           ├── VisualScriptEditor.kt
│           │           ├── VisualScriptEmitSignal.kt
│           │           ├── VisualScriptEngineSingleton.kt
│           │           ├── VisualScriptExpression.kt
│           │           ├── VisualScriptFunction.kt
│           │           ├── VisualScriptFunctionCall.kt
│           │           ├── VisualScriptFunctionState.kt
│           │           ├── VisualScriptGlobalConstant.kt
│           │           ├── VisualScriptIndexGet.kt
│           │           ├── VisualScriptIndexSet.kt
│           │           ├── VisualScriptInputAction.kt
│           │           ├── VisualScriptIterator.kt
│           │           ├── VisualScriptLists.kt
│           │           ├── VisualScriptLocalVar.kt
│           │           ├── VisualScriptLocalVarSet.kt
│           │           ├── VisualScriptMathConstant.kt
│           │           ├── VisualScriptNode.kt
│           │           ├── VisualScriptOperator.kt
│           │           ├── VisualScriptPreload.kt
│           │           ├── VisualScriptPropertyGet.kt
│           │           ├── VisualScriptPropertySet.kt
│           │           ├── VisualScriptResourcePath.kt
│           │           ├── VisualScriptReturn.kt
│           │           ├── VisualScriptSceneNode.kt
│           │           ├── VisualScriptSceneTree.kt
│           │           ├── VisualScriptSelect.kt
│           │           ├── VisualScriptSelf.kt
│           │           ├── VisualScriptSequence.kt
│           │           ├── VisualScriptSubCall.kt
│           │           ├── VisualScriptSwitch.kt
│           │           ├── VisualScriptTypeCast.kt
│           │           ├── VisualScriptVariableGet.kt
│           │           ├── VisualScriptVariableSet.kt
│           │           ├── VisualScriptWhile.kt
│           │           ├── VisualScriptYield.kt
│           │           ├── VisualScriptYieldSignal.kt
│           │           ├── VisualServer.kt
│           │           ├── VisualShader.kt
│           │           ├── VisualShaderNode.kt
│           │           ├── VisualShaderNodeBooleanConstant.kt
│           │           ├── VisualShaderNodeBooleanUniform.kt
│           │           ├── VisualShaderNodeColorConstant.kt
│           │           ├── VisualShaderNodeColorFunc.kt
│           │           ├── VisualShaderNodeColorOp.kt
│           │           ├── VisualShaderNodeColorUniform.kt
│           │           ├── VisualShaderNodeCompare.kt
│           │           ├── VisualShaderNodeCubeMap.kt
│           │           ├── VisualShaderNodeCubeMapUniform.kt
│           │           ├── VisualShaderNodeCustom.kt
│           │           ├── VisualShaderNodeDeterminant.kt
│           │           ├── VisualShaderNodeDotProduct.kt
│           │           ├── VisualShaderNodeExpression.kt
│           │           ├── VisualShaderNodeFaceForward.kt
│           │           ├── VisualShaderNodeFresnel.kt
│           │           ├── VisualShaderNodeGlobalExpression.kt
│           │           ├── VisualShaderNodeGroupBase.kt
│           │           ├── VisualShaderNodeIf.kt
│           │           ├── VisualShaderNodeInput.kt
│           │           ├── VisualShaderNodeIs.kt
│           │           ├── VisualShaderNodeOuterProduct.kt
│           │           ├── VisualShaderNodeOutput.kt
│           │           ├── VisualShaderNodeScalarClamp.kt
│           │           ├── VisualShaderNodeScalarConstant.kt
│           │           ├── VisualShaderNodeScalarDerivativeFunc.kt
│           │           ├── VisualShaderNodeScalarFunc.kt
│           │           ├── VisualShaderNodeScalarInterp.kt
│           │           ├── VisualShaderNodeScalarOp.kt
│           │           ├── VisualShaderNodeScalarSmoothStep.kt
│           │           ├── VisualShaderNodeScalarSwitch.kt
│           │           ├── VisualShaderNodeScalarUniform.kt
│           │           ├── VisualShaderNodeSwitch.kt
│           │           ├── VisualShaderNodeTexture.kt
│           │           ├── VisualShaderNodeTextureUniform.kt
│           │           ├── VisualShaderNodeTextureUniformTriplanar.kt
│           │           ├── VisualShaderNodeTransformCompose.kt
│           │           ├── VisualShaderNodeTransformConstant.kt
│           │           ├── VisualShaderNodeTransformDecompose.kt
│           │           ├── VisualShaderNodeTransformFunc.kt
│           │           ├── VisualShaderNodeTransformMult.kt
│           │           ├── VisualShaderNodeTransformUniform.kt
│           │           ├── VisualShaderNodeTransformVecMult.kt
│           │           ├── VisualShaderNodeUniform.kt
│           │           ├── VisualShaderNodeVec3Constant.kt
│           │           ├── VisualShaderNodeVec3Uniform.kt
│           │           ├── VisualShaderNodeVectorClamp.kt
│           │           ├── VisualShaderNodeVectorCompose.kt
│           │           ├── VisualShaderNodeVectorDecompose.kt
│           │           ├── VisualShaderNodeVectorDerivativeFunc.kt
│           │           ├── VisualShaderNodeVectorDistance.kt
│           │           ├── VisualShaderNodeVectorFunc.kt
│           │           ├── VisualShaderNodeVectorInterp.kt
│           │           ├── VisualShaderNodeVectorLen.kt
│           │           ├── VisualShaderNodeVectorOp.kt
│           │           ├── VisualShaderNodeVectorRefract.kt
│           │           ├── VisualShaderNodeVectorScalarMix.kt
│           │           ├── VisualShaderNodeVectorScalarSmoothStep.kt
│           │           ├── VisualShaderNodeVectorScalarStep.kt
│           │           ├── VisualShaderNodeVectorSmoothStep.kt
│           │           ├── WeakRef.kt
│           │           ├── WebRTCDataChannel.kt
│           │           ├── WebRTCDataChannelGDNative.kt
│           │           ├── WebRTCMultiplayer.kt
│           │           ├── WebRTCPeerConnection.kt
│           │           ├── WebRTCPeerConnectionGDNative.kt
│           │           ├── WebSocketClient.kt
│           │           ├── WebSocketMultiplayerPeer.kt
│           │           ├── WebSocketPeer.kt
│           │           ├── WebSocketServer.kt
│           │           ├── WindowDialog.kt
│           │           ├── World.kt
│           │           ├── World2D.kt
│           │           ├── WorldEnvironment.kt
│           │           ├── X509Certificate.kt
│           │           ├── XMLParser.kt
│           │           ├── YSort.kt
│           │           ├── icalls/
│           │           │   └── __icalls.kt
│           │           └── registerEngineTypes.kt
│           ├── nativeInternal/
│           │   └── kotlin/
│           │       └── godot/
│           │           └── internal/
│           │               ├── KObject.kt
│           │               ├── type/
│           │               │   ├── CoreType.kt
│           │               │   ├── nullSafety.kt
│           │               │   └── typeSize.kt
│           │               └── utils/
│           │                   └── getFromGDNative.kt
│           ├── nativeInterop/
│           │   └── cinterop/
│           │       └── godot.def
│           └── nativePublic/
│               └── kotlin/
│                   └── godot/
│                       ├── annotation/
│                       │   ├── PropertyTypeHintAnnotation.kt
│                       │   └── RegisterAnnotation.kt
│                       ├── extensions.kt
│                       ├── global/
│                       │   ├── GD.kt
│                       │   ├── GDCore.kt
│                       │   ├── GDMath.kt
│                       │   ├── GDPrint.kt
│                       │   └── GDRandom.kt
│                       ├── helper/
│                       │   └── Vararg.kt
│                       └── registration/
│                           └── Range.kt
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── plugins/
│   └── godot-gradle-plugin/
│       ├── build.gradle.kts
│       └── src/
│           └── main/
│               ├── kotlin/
│               │   └── godot/
│               │       └── gradle/
│               │           ├── GenerateGdnlib.kt
│               │           ├── GodotExtension.kt
│               │           ├── GodotPlatform.kt
│               │           ├── GodotPlugin.kt
│               │           └── subplugin/
│               │               └── GodotSubPlugin.kt
│               └── resources/
│                   └── META-INF/
│                       └── services/
│                           └── org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin
├── samples/
│   ├── 3d-platformer/
│   │   ├── .import/
│   │   │   ├── cutout.png-8aacc6c936bf12e889c8e11f6c4eb91c.md5
│   │   │   ├── cutout.png-8aacc6c936bf12e889c8e11f6c4eb91c.stex
│   │   │   ├── icon.png-487276ed1e3a0c39cad0279d744ee560.md5
│   │   │   ├── icon.png-487276ed1e3a0c39cad0279d744ee560.stex
│   │   │   ├── osb_down.png-4a1ab934f787719766862b499528d054.md5
│   │   │   ├── osb_down.png-4a1ab934f787719766862b499528d054.stex
│   │   │   ├── osb_fire.png-e657a73546eb75918e9d9a3fea15cf70.md5
│   │   │   ├── osb_fire.png-e657a73546eb75918e9d9a3fea15cf70.stex
│   │   │   ├── osb_jump.png-dbbef3b47abbb562ce6c81a9701121c6.md5
│   │   │   ├── osb_jump.png-dbbef3b47abbb562ce6c81a9701121c6.stex
│   │   │   ├── osb_left.png-fc7230aeb0eec74933ed08f89b893288.md5
│   │   │   ├── osb_left.png-fc7230aeb0eec74933ed08f89b893288.stex
│   │   │   ├── osb_right.png-5cf5add2dbc1c8dde17173ac56f3a004.md5
│   │   │   ├── osb_right.png-5cf5add2dbc1c8dde17173ac56f3a004.stex
│   │   │   ├── osb_up.png-6a05b6a7bf0ede3756308a5cffdd2b9a.md5
│   │   │   ├── osb_up.png-6a05b6a7bf0ede3756308a5cffdd2b9a.stex
│   │   │   ├── panorama.png-e05131d3dca9fd5b03101f18fbe08995.md5
│   │   │   ├── panorama.png-e05131d3dca9fd5b03101f18fbe08995.stex
│   │   │   ├── robot_walk.wav-4313e7d5f563e62e3923080b14a79c15.md5
│   │   │   ├── robot_walk.wav-4313e7d5f563e62e3923080b14a79c15.sample
│   │   │   ├── shine.png-a8253c1d2dc8acbf187823f695c13207.etc2.stex
│   │   │   ├── shine.png-a8253c1d2dc8acbf187823f695c13207.md5
│   │   │   ├── shine.png-a8253c1d2dc8acbf187823f695c13207.s3tc.stex
│   │   │   ├── sound_coin.wav-b4defacd1a1eab95585c7b5095506878.md5
│   │   │   ├── sound_coin.wav-b4defacd1a1eab95585c7b5095506878.sample
│   │   │   ├── sound_explode.wav-23e94be75a4346bffb517c7e07035977.md5
│   │   │   ├── sound_explode.wav-23e94be75a4346bffb517c7e07035977.sample
│   │   │   ├── sound_hit.wav-d8455980ada2d4a9a73508948d7317cc.md5
│   │   │   ├── sound_hit.wav-d8455980ada2d4a9a73508948d7317cc.sample
│   │   │   ├── sound_jump.wav-4966d1f327e26a176b56ab335c03b5e1.md5
│   │   │   ├── sound_jump.wav-4966d1f327e26a176b56ab335c03b5e1.sample
│   │   │   ├── sound_shoot.wav-f0f26619cba21d411b53ad23b8788116.md5
│   │   │   ├── sound_shoot.wav-f0f26619cba21d411b53ad23b8788116.sample
│   │   │   ├── texture.png-77dc6ecaf884a35cd9dbaf886cacc46d.md5
│   │   │   ├── texture.png-77dc6ecaf884a35cd9dbaf886cacc46d.stex
│   │   │   ├── texturemr.png-0568a8b09834741143da53ce460e36f1.etc2.stex
│   │   │   ├── texturemr.png-0568a8b09834741143da53ce460e36f1.md5
│   │   │   └── texturemr.png-0568a8b09834741143da53ce460e36f1.s3tc.stex
│   │   ├── build.gradle.kts
│   │   ├── bullet.gd
│   │   ├── bullet.scn
│   │   ├── coin.gd
│   │   ├── coin.scn
│   │   ├── cutout.png.import
│   │   ├── default_bus_layout.tres
│   │   ├── enemy.gd
│   │   ├── enemy.scn
│   │   ├── export_presets.cfg
│   │   ├── follow_camera.gd
│   │   ├── gradle/
│   │   │   └── wrapper/
│   │   │       ├── gradle-wrapper.jar
│   │   │       └── gradle-wrapper.properties
│   │   ├── gradle.properties
│   │   ├── gradlew
│   │   ├── gradlew.bat
│   │   ├── icon.png.import
│   │   ├── osb_down.png.import
│   │   ├── osb_fire.png.import
│   │   ├── osb_jump.png.import
│   │   ├── osb_left.png.import
│   │   ├── osb_right.png.import
│   │   ├── osb_up.png.import
│   │   ├── panorama.png.import
│   │   ├── platformer3d.gdnlib
│   │   ├── player.gd
│   │   ├── player.scn
│   │   ├── project.godot
│   │   ├── robot_walk.wav.import
│   │   ├── robotrigged.scn
│   │   ├── sb.cube
│   │   ├── settings.gradle.kts
│   │   ├── shine.png.import
│   │   ├── sound_coin.wav.import
│   │   ├── sound_explode.wav.import
│   │   ├── sound_hit.wav.import
│   │   ├── sound_jump.wav.import
│   │   ├── sound_shoot.wav.import
│   │   ├── src/
│   │   │   ├── gdns/
│   │   │   │   └── kotlin/
│   │   │   │       ├── Bullet.gdns
│   │   │   │       ├── Coin.gdns
│   │   │   │       ├── Enemy.gdns
│   │   │   │       ├── FollowCamera.gdns
│   │   │   │       └── Player.gdns
│   │   │   └── godotMain/
│   │   │       └── kotlin/
│   │   │           ├── Bullet.kt
│   │   │           ├── Coin.kt
│   │   │           ├── Enemy.kt
│   │   │           ├── FollowCamera.kt
│   │   │           └── Player.kt
│   │   ├── stage.scn
│   │   ├── texture.png.import
│   │   ├── texturemr.png.import
│   │   ├── tiles.res
│   │   └── tiles.scn
│   ├── README.md
│   └── mini-games/
│       ├── Node2D.tscn
│       ├── Sprite.gd
│       ├── build.gradle.kts
│       ├── default_env.tres
│       ├── gradle/
│       │   └── wrapper/
│       │       ├── gradle-wrapper.jar
│       │       └── gradle-wrapper.properties
│       ├── gradle.properties
│       ├── gradlew
│       ├── gradlew.bat
│       ├── icon.png.import
│       ├── mini-games.gdnlib
│       ├── project.godot
│       ├── settings.gradle.kts
│       └── src/
│           ├── gdns/
│           │   └── kotlin/
│           │       └── example/
│           │           ├── TestingClass.gdns
│           │           └── TextureSample.gdns
│           └── godotMain/
│               └── kotlin/
│                   └── example/
│                       ├── TestEnum.kt
│                       ├── TestingClass.kt
│                       └── TextureSample.kt
├── settings.gradle.kts
└── utils/
    ├── composite-build-support/
    │   ├── README.md
    │   └── build.gradle.kts
    └── godot-build-props/
        ├── build.gradle.kts
        └── src/
            └── main/
                ├── kotlin/
                │   └── godot/
                │       └── utils/
                │           └── GodotBuildProperties.kt
                └── resources/
                    └── build.properties

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
[*.{kt, kts}]
indent_size = 4
indent_style = space
insert_final_newline = true

================================================
FILE: .gitattributes
================================================
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat           text eol=crlf
old/*           linguist-generated=true
godot-kotlin/godot-library/src/nativeGen/kotlin/*           linguist-generated=true


================================================
FILE: .github/CODEOWNERS
================================================
# fallback to everyone if there is no match
* @CedNaru @chippmann @raniejade @piiertho

# entry generator
entry-generation/* @chippmann @raniejade

# gradle plugin
plugins/godot-gradle-plugin/* @raniejade

# core types
godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/*.kt @CedNaru

# api generation
buildSrc/src/main/kotlin/godot/codegen/*.kt @piiertho
buildSrc/src/main/kotlin/godot/tasks/GenerateApiTask.kt @piiertho

# samples/demos
samples/3d-platformer @raniejade

# documentation
docs/* @raniejade
.readthedocs.yml @raniejade

================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Version:**

**OS/device including version:**

**Issue description:**

**Steps to reproduce:**

**Minimal reproduction project:**


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Describe the problem or limitation you are having in your project:**

**Describe how this feature / enhancement will help you overcome this problem or limitation:**

**Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:**

**Describe implementation detail for your proposal (in code), if possible:**

**If this enhancement will not be used often, can it be worked around with a few lines of code?:**

**Is there a reason why this should be in this project and not individually solved?:**


================================================
FILE: .github/bin/check-repo-is-clean.sh
================================================
#!/usr/bin/env bash

if [ -n "$(git status --porcelain)" ]; then
  echo "Generated code is stale, please commit them!"
  exit 1
else
  echo "Generated code up-to-date."
fi

================================================
FILE: .github/workflows/CI.yaml
================================================
name: CI
on:
  push:
    branches:
      - master
    tags:
      - '*'

jobs:
  deploy_core:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1000
      - run: git fetch --depth=1000 origin +refs/tags/*:refs/tags/*
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-library:bintrayUpload -PignoreSamples
        env:
          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
  deploy_build_props:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1000
      - run: git fetch --depth=1000 origin +refs/tags/*:refs/tags/*
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-build-props:bintrayUpload -PignoreSamples
        env:
          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
  deploy_entry_generator:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1000
      - run: git fetch --depth=1000 origin +refs/tags/*:refs/tags/*
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-entry-generator:bintrayUpload -PignoreSamples
        env:
          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
  deploy_annotation_processor:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1000
      - run: git fetch --depth=1000 origin +refs/tags/*:refs/tags/*
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-annotation-processor:bintrayUpload -PignoreSamples
        env:
          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
  deploy_compiler_plugin_common:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1000
      - run: git fetch --depth=1000 origin +refs/tags/*:refs/tags/*
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-compiler-plugin-common:bintrayUpload -PignoreSamples
        env:
          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
  deploy_compiler_plugin:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1000
      - run: git fetch --depth=1000 origin +refs/tags/*:refs/tags/*
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-compiler-plugin:bintrayUpload -PignoreSamples
        env:
          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
  deploy_compiler_native_plugin:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1000
      - run: git fetch --depth=1000 origin +refs/tags/*:refs/tags/*
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-compiler-native-plugin:bintrayUpload -PignoreSamples
        env:
          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
  deploy_godot_gradle_plugin:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1000
      - run: git fetch --depth=1000 origin +refs/tags/*:refs/tags/*
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-gradle-plugin:bintrayUpload -PignoreSamples
        env:
          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
          BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}

================================================
FILE: .github/workflows/check-pr-annotation-processor.yaml
================================================
name: Check PR - godot-annotation-processor
on:
  pull_request:
    paths:
      - 'plugins/godot-annotation-processor/**'
      - 'plugins/godot-entry-generator/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - 'settings.gradle.kts'
      - '.github/workflows/check-pr-annotation-processor.yaml'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-annotation-processor:build -PignoreSamples

================================================
FILE: .github/workflows/check-pr-build-props.yaml
================================================
name: Check PR - godot-build-props
on:
  pull_request:
    paths:
      - 'utils/godot-build-props/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - '.github/workflows/check-pr-build-props.yaml'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-build-props:build -PignoreSamples

================================================
FILE: .github/workflows/check-pr-codegen-uptodate.yaml
================================================
name: Check PR - codegen-uptodate
on: pull_request

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-library:generateAPI
      - run: .github/bin/check-repo-is-clean.sh

================================================
FILE: .github/workflows/check-pr-compiler-native-plugin.yaml
================================================
name: Check PR - godot-compiler-native-plugin
on:
  pull_request:
    paths:
      - 'entry-generation/godot-compiler-native-plugin/**'
      - 'entry-generation/godot-compiler-plugin-common/**'
      - 'entry-generation/godot-entry-generator/**'
      - 'entry-generation/godot-annotation-processor/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - 'settings.gradle.kts'
      - '.github/workflows/check-pr-compiler-native-plugin.yaml'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-compiler-native-plugin:build -PignoreSamples

================================================
FILE: .github/workflows/check-pr-compiler-plugin-common.yaml
================================================
name: Check PR - godot-compiler-plugin-common
on:
  pull_request:
    paths:
      - 'entry-generation/godot-compiler-plugin-common/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - '.github/workflows/check-pr-compiler-plugin-common.yaml'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-compiler-plugin-common:build -PignoreSamples

================================================
FILE: .github/workflows/check-pr-compiler-plugin.yaml
================================================
name: Check PR - godot-compiler-plugin
on:
  pull_request:
    paths:
      - 'entry-generation/godot-compiler-plugin/**'
      - 'entry-generation/godot-compiler-plugin-common/**'
      - 'entry-generation/godot-entry-generator/**'
      - 'entry-generation/godot-annotation-processor/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - 'settings.gradle.kts'
      - '.github/workflows/check-pr-compiler-plugin.yaml'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-compiler-plugin:build -PignoreSamples

================================================
FILE: .github/workflows/check-pr-core.yaml
================================================
name: Check PR - godot-library
on:
  pull_request:
    paths:
      - 'godot-kotlin/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - '.github/workflows/check-pr-core.yaml'

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        include:
          - os: ubuntu-latest
            task: compileKotlinLinux
          - os: macos-latest
            task: compileKotlinMacos
          - os: windows-latest
            task: compileKotlinWindows
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-library:${{ matrix.task }} -PignoreSamples

================================================
FILE: .github/workflows/check-pr-entry-generator.yaml
================================================
name: Check PR - godot-entry-generator
on:
  pull_request:
    paths:
      - 'entry-generation/godot-entry-generator/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - '.github/workflows/check-pr-entry-generator.yaml'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-entry-generator:build -PignoreSamples

================================================
FILE: .github/workflows/check-pr-gradle-plugin.yaml
================================================
name: Check PR - godot-gradle-plugin
on:
  pull_request:
    paths:
      - 'plugins/godot-gradle-plugin/**'
      - 'utils/godot-build-props/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - 'settings.gradle.kts'
      - '.github/workflows/check-pr-gradle-plugin.yaml'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: godot-gradle-plugin:build -PignoreSamples

================================================
FILE: .github/workflows/check-pr-samples-3d-platformer.yaml
================================================
name: Check PR - samples-3d-platformer
on:
  pull_request:
    paths:
      - 'entry-generation/godot-compiler-native-plugin/**'
      - 'entry-generation/godot-compiler-plugin-common/**'
      - 'entry-generation/godot-entry-generator/**'
      - 'entry-generation/godot-annotation-processor/**'
      - 'godot-kotlin/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - 'samples/3d-platformer/**'
      - '.github/workflows/check-pr-samples-3d-platform.yaml'

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        include:
          - os: ubuntu-latest
            task: buildLinuxX64
            publish_task: publishToMavenLocal
          - os: macos-latest
            task: -x linkDebugSharedLinuxX64 buildMacosX64
            publish_task: -x publishLinuxPublicationToMavenLocal publishToMavenLocal
          - os: windows-latest
            task: -x linkDebugSharedLinuxX64 buildWindowsX64
            publish_task: -x publishLinuxPublicationToMavenLocal publishToMavenLocal
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Publish artifacts locally
        uses: eskatos/gradle-command-action@v1
        with:
          arguments: ${{ matrix.publish_task }} -Pgodot.kotlin.dev
      - uses: eskatos/gradle-command-action@v1
        with:
          build-root-directory: samples/3d-platformer
          arguments: ${{ matrix.task }} -Pgodot.kotlin.dev

================================================
FILE: .github/workflows/check-pr-samples-mini-games.yaml
================================================
name: Check PR - samples-mini-games
on:
  pull_request:
    paths:
      - 'entry-generation/godot-compiler-native-plugin/**'
      - 'entry-generation/godot-compiler-plugin-common/**'
      - 'entry-generation/godot-entry-generator/**'
      - 'entry-generation/godot-annotation-processor/**'
      - 'godot-kotlin/**'
      - 'build.gradle.kts'
      - 'buildSrc/**'
      - 'gradle.properties'
      - 'samples/min-games/**'
      - '.github/workflows/check-pr-samples-mini-games.yaml'

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        include:
          - os: ubuntu-latest
            task: buildLinuxX64
            publish_task: publishToMavenLocal
          - os: macos-latest
            task: -x linkDebugSharedLinuxX64 buildMacosX64
            publish_task: -x publishLinuxPublicationToMavenLocal publishToMavenLocal
          - os: windows-latest
            task: -x linkDebugSharedLinuxX64 buildWindowsX64
            publish_task: -x publishLinuxPublicationToMavenLocal publishToMavenLocal
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Checkout submodules
        uses: snickerbockers/submodules-init@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Publish artifacts locally
        uses: eskatos/gradle-command-action@v1
        with:
          arguments: ${{ matrix.publish_task }} -Pgodot.kotlin.dev
      - uses: eskatos/gradle-command-action@v1
        with:
          build-root-directory: samples/mini-games
          arguments: ${{ matrix.task }} -Pgodot.kotlin.dev


================================================
FILE: .gitignore
================================================
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

# IntelliJ IDEA
**/.idea/*
!**/.idea/codeStyles/*

/samples/mini-games/.import/

# OSX
.DS_Store


================================================
FILE: .gitmodules
================================================
[submodule "godot-kotlin/godot-headers"]
	path = godot-kotlin/godot-headers
	url = https://github.com/GodotNativeTools/godot_headers


================================================
FILE: .readthedocs.yml
================================================
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation with MkDocs
mkdocs:
 configuration: docs/mkdocs.yml

# Optionally set the version of Python and requirements required to build your docs
python:
  version: 3.7
  install:
    - requirements: docs/requirements.txt

================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2020 godot-kotlin Maintainers and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
![Kotlin GDNative Logo](docs/src/doc/assets/img/logo.png)

# Kotlin/Native binding for the Godot Game Engine

## Overview

This is a **Kotlin** language binding for the [**Godot**](https://godotengine.org/) game engine. It uses [**GDNative**](https://godotengine.org/article/dlscript-here) to interact with **Godot**'s core api's. The binding provides you Godot API's as Kotlin classes, so you can write your game logic completely in Kotlin. It will be compiled into a dynamic library using [*Kotlin/Native*](https://kotlinlang.org/docs/reference/native-overview.html).
You don't have to worry about any binding logic. Just write your game scripts like you would for [GDScript](https://docs.godotengine.org/en/3.1/getting_started/scripting/gdscript/gdscript_basics.html) or [C#](https://docs.godotengine.org/en/3.1/getting_started/scripting/c_sharp/) but with all the syntactic sugar of kotlin.

[![GitHub](https://img.shields.io/github/license/utopia-rise/godot-kotlin?style=flat-square)](LICENSE)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/utopia-rise/godot-kotlin/CI?style=flat-square)](https://github.com/utopia-rise/godot-kotlin/actions?query=workflow%3ACI)

## Important notes

This version of the binding is currently in **Alpha** state and by no means production ready!  

This state will not change in the near foreseeable future. The Kotlin Native performance is not where it needs to be to make this binding efficient. Currently, the build times are incredibly slow due to the lack of incremental build support in Kotlin Native. Also, the runtime performance is much slower than GDScript in many cases.  
The only case where this binding shines at the moment is in computation heavy scenarios like implementing an A* pathfinding algorithm where not many calls through the cinterop layer of K/N are necessary. In all other cases were many calls are needed, like Input checking and small logic in function like `_process`, the performance is not great because of the current performance of the K/N cinterop layer.  
We were and are in touch with JB regarding those issues on youtrack and slack: [KT-40652](https://youtrack.jetbrains.com/issue/KT-40652) and [KT-40679](https://youtrack.jetbrains.com/issue/KT-40679)

To still be able to use kotlin in a performant way, we started another project [(godot-jvm)](https://github.com/utopia-rise/godot-jvm/) which leverages an embedded JVM to use kotlin on the JVM rather than native. On our first tests, this increases performance dramatically and one can leverage the full JVM ecosystem. Head over there to see development updates.  
This binding will not die though. We will provide bugfixes for existing bugs if necessary, keep it as up to date as our time allows us to do, but we will not improve tooling or add new features until the performance of K/N is more acceptable.

## Documentation

One can find the documentation for this binding [here](https://godot-kotl.in).

## Developer discussion

Ask questions and collaborate on Discord:
https://discord.gg/qSU2EQs

## Setting up IntelliJ IDEA for local builds or contribution
1. Add `godot.kotlin.dev` to `~/.gradle/gradle.properties` (on Windows you might need to stop any Gradle daemons running for this property to be picked up)
2. Run the initial build: `./gradlew publishToMavenLocal`  (this will take a while)
3. In IntelliJ IDEA, import the root `build.gradle.kts`.
4. After importing the main binding, in the Gradle sidebar in IntelliJ IDEA, import the `build.gradle.kts` of the sample you want to import. (repeat for every sample you want to develop)

## Contribution Guidelines:
- **CodeStyle:**  
We enforce the code style to match the official kotlin [coding conventions](https://kotlinlang.org/docs/reference/coding-conventions.html). Read there on how to set those up for your IDE.  
We will enforce this later on through CI and linting.  
- **Branching:**  
We do branching like described in `git-flow`.

Each Issue has a Maintainer that is the "supervisor" for the general topic the issue belongs to. Discuss implementation details with this maintainer.

================================================
FILE: build.gradle.kts
================================================
plugins {
    id("org.ajoberstar.grgit") version "4.0.2"
}

val currentCommit = grgit.head()
// check if the current commit is tagged
var releaseMode = grgit.tag.list().firstOrNull { tag -> tag.commit.id == currentCommit.id } != null
val devMode = project.hasProperty("godot.kotlin.dev")
if (devMode && !releaseMode) {
    println("Dev mode detected, using static versioning")
    version = "0.0.1"
} else {
    version = "0.1.0-${DependenciesVersions.godotVersion}"
    if (!releaseMode) {
        version = "$version-${currentCommit.abbreviatedId}"
    }
}

val versionString = project.version.toString()
println("Inferred version: $versionString (release=$releaseMode)")

subprojects {
    group = "com.utopia-rise"
    version = versionString
    repositories {
        mavenLocal()
        jcenter()
    }
    extra["releaseMode"] = releaseMode
}


================================================
FILE: buildSrc/build.gradle.kts
================================================
plugins {
    `kotlin-dsl`
}

repositories {
    jcenter()
    mavenCentral()
    gradlePluginPortal()
}

dependencies {
    implementation(kotlin("gradle-plugin", version = "1.3.72"))
    implementation("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5")
    implementation("com.fasterxml.jackson.core:jackson-databind:2.11.0")

    //Remember to change version according to DependenciesVersion
    implementation("com.squareup:kotlinpoet:1.5.0")
}


================================================
FILE: buildSrc/src/main/kotlin/BintrayPublish.kt
================================================
import com.jfrog.bintray.gradle.BintrayExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.extra

class BintrayPublish : Plugin<Project> {
    override fun apply(target: Project) {
        target.plugins.apply("com.jfrog.bintray")
        target.plugins.apply("maven-publish")

        val bintrayUser = target.propOrEnv("BINTRAY_USER")
        val bintrayApiKey = target.propOrEnv("BINTRAY_API_KEY")

        var bintrayRepo = "godot-kotlin-dev"
        var doPublish = true

        //TODO : See how to handle release according to branch and tags
        if (target.extra["releaseMode"] == true) {
            bintrayRepo = "godot-kotlin"
            doPublish = false
        }

        val artifacts = target.extra["artifacts"] as Array<String>

        target.extensions.configure(BintrayExtension::class.java) {
            user = bintrayUser
            key = bintrayApiKey
            publish = doPublish
            with(pkg) {
                userOrg = "utopia-rise"
                repo = bintrayRepo
                desc = "Kotlin Native bindings for Godot Engine"
                name = "godot-kotlin"
                setLicenses("MIT")
                setLabels("kotlin", "godot", "gamedev", "godotengine")
                vcsUrl = "https://github.com/utopia-rise/godot-kotlin.git"
                githubRepo = "utopia-rise/godot-kotlin"
                with(version) {
                    name = project.rootProject.version.toString()
                }
            }

            setPublications(*artifacts)
        }

        target.extensions.configure(PublishingExtension::class.java) {
            publications {
                all {
                    if (this@all is MavenPublication) {
                        pom {
                            url.set("https://github.com/utopia-rise/godot-kotlin")
                            licenses {
                                license {
                                    name.set("MIT")
                                    url.set("https://github.com/utopia-rise/godot-kotlin/blob/master/LICENSE")
                                    distribution.set("repo")
                                }
                            }
                            scm {
                                connection.set("scm:git:https://github.com/utopia-rise/godot-kotlin")
                                developerConnection.set("scm:git:github.com:utopia-rise/godot-kotlin.git")
                                tag.set("master")
                                url.set("https://github.com/utopia-rise/godot-kotlin")
                            }

                            developers {
                                developer {
                                    id.set("core")
                                    name.set("Ranie Jade Ramiso")
                                    url.set("https://github.com/raniejade")
                                    email.set("raniejaderamiso@gmail.com")
                                }
                                developer {
                                    id.set("core")
                                    name.set("Pierre-Thomas Meisels")
                                    url.set("https://github.com/piiertho")
                                    email.set("meisels27@yahoo.fr")
                                }
                                developer {
                                    id.set("core")
                                    name.set("Cedric Hippmann")
                                    url.set("https://github.com/chippmann")
                                    email.set("cedric.hippmann@hotmail.com")
                                }
                                developer {
                                    id.set("core")
                                    name.set("Tristan Grespinet")
                                    url.set("https://github.com/CedNaru")
                                    email.set("ced.naru@gmail.com")
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

fun Project.propOrEnv(name: String): String? {
    var property: String? = findProperty(name) as String?
    if (property == null) {
        property = System.getenv(name)
    }
    return property
}


================================================
FILE: buildSrc/src/main/kotlin/DependenciesVersions.kt
================================================
object DependenciesVersions {
    const val mpaptVersion: String = "0.8.5"
    const val shadowJarPluginVersion: String = "5.0.0"
    const val kotlinPoetVersion: String = "1.5.0"
    const val godotVersion: String = "3.2"
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/Argument.kt
================================================
package godot.codegen

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty


@JsonIgnoreProperties(ignoreUnknown = true)
class Argument @JsonCreator constructor(
    @JsonProperty("name")
    var name: String,
    @JsonProperty("type")
    var type: String,
    @JsonProperty("has_default_value")
    val hasDefaultValue: Boolean = false,
    @JsonProperty("default_value")
    var defaultValue: String = ""
) {
    val nullable: Boolean

    val applyDefault: String?

    init {
        name = name.convertToCamelCase().escapeKotlinReservedNames()
        type = type.convertTypeToKotlin()

        if (defaultValue == "[Object:null]" || defaultValue == "Null") {
            defaultValue = "null"
            nullable = true
        } else {
            nullable = false
        }

        applyDefault = if (hasDefaultValue && nullable) {
            "null"
        } else if (hasDefaultValue) {
            when (type) {
                "Color", "Variant" -> "$type($defaultValue)"
                "Boolean" -> defaultValue.toLowerCase()
                "Double" -> intToFloat(defaultValue)
                "Vector2", "Vector3", "Rect2" -> "$type${defaultValue.replace(",", ".0,")
                    .replace(")", ".0)")}"
                "Dictionary", "Transform", "Transform2D", "VariantArray", "RID", "PoolVector2Array", "PoolStringArray",
                "PoolVector3Array", "PoolColorArray", "PoolIntArray", "PoolRealArray", "PoolByteArray" -> "$type()"
                "String" -> "\"$defaultValue\""
                else -> defaultValue
            }
        } else {
            null
        }
    }

    private fun intToFloat(defaultValue: String): String {
        if (defaultValue.indexOf('.') != -1) return defaultValue

        return "$defaultValue.0"
    }
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/Class.kt
================================================
package godot.codegen

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
import java.io.File


@JsonIgnoreProperties(ignoreUnknown = true)
class Class @JsonCreator constructor(
    @JsonProperty("name")
    val oldName: String,
    @JsonProperty("base_class")
    var baseClass: String,
    @JsonProperty("singleton")
    val isSingleton: Boolean,
    @JsonProperty("singleton_name")
    val singletonName: String,
    @JsonProperty("instanciable")
    val isInstanciable: Boolean,
    @JsonProperty("constants")
    val constants: Map<String, Int>,
    @JsonProperty("properties")
    val properties: List<Property>,
    @JsonProperty("signals")
    val signals: List<Signal>,
    @JsonProperty("methods")
    val methods: List<Method>,
    @JsonProperty("enums")
    val enums: List<Enum>
) {

    val newName: String = oldName.escapeUnderscore()
    var shouldGenerate: Boolean = true
    val additionalImports = mutableListOf<Pair<String, String>>()

    init {
        baseClass = baseClass.escapeUnderscore()
    }

    fun generate(outputDir: File, tree: Graph<Class>, icalls: MutableSet<ICall>) {
        shouldGenerate = newName != "GlobalConstants" && tree.getBaseClass(this)?.isSingleton == false
            || isInstanciable || isSingleton

        if (!shouldGenerate) return

        applyGettersAndSettersForProperties()

        val className = ClassName("godot", newName)

        val classTypeBuilder = createTypeBuilder(className)

        if (newName == "Object") {
            classTypeBuilder.superclass(ClassName("godot.internal", "KObject"))
            generateSignalExtensions(classTypeBuilder)
            generateToVariantMethod(classTypeBuilder)
        }

        generateConstructors(classTypeBuilder)

        generateEnums(classTypeBuilder)

        val baseCompanion = if (!isSingleton && constants.isNotEmpty()) TypeSpec.companionObjectBuilder() else null

        generateConstants(baseCompanion ?: classTypeBuilder)

        generateSignals(classTypeBuilder)
        generateProperties(tree, icalls, classTypeBuilder)
        generateMethods(classTypeBuilder, tree, icalls)

        baseCompanion?.build()?.let { classTypeBuilder.addType(it) }

        //Build Type and create file
        val fileBuilder = FileSpec
            .builder("godot", className.simpleName)
            .addType(classTypeBuilder.build())

        additionalImports.forEach {
            fileBuilder.addImport(it.first, it.second)
        }

        fileBuilder
            .addComment("THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD")
            .build()
            .writeTo(outputDir)
    }

    private fun applyGettersAndSettersForProperties() {
        properties.forEach { property ->
            methods.forEach { method ->
                property applyGetterOrSetter method
            }
        }
    }

    private fun createTypeBuilder(className: ClassName): TypeSpec.Builder {
        val typeSpec = if (isSingleton) TypeSpec.objectBuilder(className)
        else TypeSpec.classBuilder(className).addModifiers(KModifier.OPEN)

        if (isSingleton) typeSpec.superclass(ClassName("godot", "Object"))
        else if (baseClass.isNotEmpty()) typeSpec.superclass(ClassName("godot", baseClass))

        return typeSpec
    }

    private fun generateSignalExtensions(typeBuilder: TypeSpec.Builder) {

        fun List<TypeVariableName>.toParameterTypes() = this.map {
            ParameterSpec.builder(it.name.toLowerCase(), it).build()
        }

        val typeVariablesNames = mutableListOf<TypeVariableName>()
        for (i in 0..10) {
            if (i != 0) typeVariablesNames.add(TypeVariableName.invoke("A${i - 1}"))

            val signalType = ClassName("godot.core", "Signal$i")

            val emitFunBuilder = FunSpec.builder("emit")

            val signalParameterizedType = if (typeVariablesNames.isNotEmpty()) {
                val parameterSpecs = typeVariablesNames.toParameterTypes()
                emitFunBuilder.addTypeVariables(typeVariablesNames)
                emitFunBuilder.addParameters(parameterSpecs)
                emitFunBuilder.addStatement(
                    "%L(this@Object, ${
                    parameterSpecs
                        .map { it.name }
                        .reduce{ acc, string -> "$acc, $string" }
                    })",
                "emit"
                )
                signalType.parameterizedBy(typeVariablesNames)
            }
            else {
                emitFunBuilder.addStatement(
                    "%L(this@Object)",
                    "emit"
                )
                signalType
            }

            emitFunBuilder.receiver(signalParameterizedType)

            typeBuilder.addFunction(emitFunBuilder.build())

            val kTypeVariable = TypeVariableName.invoke(
                "K",
                bounds = *arrayOf(
                    LambdaTypeName.get(
                        returnType = UNIT,
                        parameters = *typeVariablesNames.toTypedArray()
                    )
                )
            ).copy(reified = true)
            val connectTypeVariableNames = listOf(
                *typeVariablesNames.toTypedArray(),
                kTypeVariable
            )

            val objectType = ClassName("godot", "Object")
            typeBuilder.addFunction(
                FunSpec.builder("connect")
                    .receiver(signalParameterizedType)
                    .addTypeVariables(connectTypeVariableNames)
                    .addModifiers(KModifier.INLINE)
                    .addParameters(
                        listOf(
                            ParameterSpec.builder("target", objectType)
                                .build(),
                            ParameterSpec.builder("method", kTypeVariable)
                                .build(),
                            ParameterSpec.builder("binds", ClassName("godot.core", "VariantArray").copy(nullable = true))
                                .defaultValue("null")
                                .build(),
                            ParameterSpec.builder("flags", Long::class)
                                .defaultValue("0")
                                .build()
                        )
                    )
                    .addCode("""
                            |val methodName = (method as %T<%T>).name
                            |connect(this@%T, target, methodName, binds, flags)
                            |""".trimMargin(),
                        ClassName("kotlin.reflect", "KCallable"),
                        UNIT,
                        objectType
                    )
                    .build()
            )
        }
    }

    private fun generateConstructors(typeBuilder: TypeSpec.Builder) {
        val newFunBuilder = FunSpec.builder("__new")
            .returns(ClassName("kotlinx.cinterop", "COpaquePointer"))
            .addModifiers(KModifier.OVERRIDE)

        if (isSingleton) {
            newFunBuilder.addCode(
                CodeBlock.of("""
                            |return %M {
                            |    val ptr = %M(%T.gdnative.godot_global_get_singleton).%M("$singletonName".%M.ptr)
                            |    %M(ptr) { "No instance found for singleton $singletonName" }
                            |    ptr
                            |}
                            |""".trimMargin(),
                    MemberName("kotlinx.cinterop", "memScoped"),
                    MemberName("godot.internal.type", "nullSafe"),
                    ClassName("godot.core", "Godot"),
                    MemberName("kotlinx.cinterop", "invoke"),
                    MemberName("kotlinx.cinterop", "cstr"),
                    MemberName("kotlin", "requireNotNull")
                )
            )
        } else {
            if (isInstanciable) {
                newFunBuilder.addStatement(
                    "return %M(\"$newName\", \"$oldName\")",
                    MemberName("godot.internal.utils", "invokeConstructor")
                )
            }

            val primaryConstructorBuilder = FunSpec.constructorBuilder()
                .callSuperConstructor()

            if (!isInstanciable) {
                primaryConstructorBuilder.addModifiers(KModifier.INTERNAL)
            }
            typeBuilder.primaryConstructor(primaryConstructorBuilder.build())
        }

        if (isInstanciable || isSingleton) {
            typeBuilder.addFunction(newFunBuilder.build())
        }
    }

    private fun generateEnums(typeBuilder: TypeSpec.Builder) {
        enums.forEach {
            typeBuilder.addType(it.generated)
        }
    }

    private fun generateSignals(typeBuilder: TypeSpec.Builder) {
        signals.forEach {
            if (properties.map { p -> p.name }.contains(it.name)) it.name = "signal${it.name.capitalize()}"
            typeBuilder.addProperty(it.generated)
        }
    }

    private fun generateConstants(baseCompanion: TypeSpec.Builder) {
        // for easy lookup
        val allEnumValues = enums.flatMap { it.values.keys }
            .toSet()
        constants.filter { !allEnumValues.contains(it.key) }
            .forEach { (key, value) ->
            baseCompanion.addProperty(
                PropertySpec
                    .builder(key, Long::class)
                    .addModifiers(KModifier.CONST, KModifier.FINAL)
                    .initializer("%L", value)
                    .build()
            )
        }
    }

    private fun generateProperties(
        tree: Graph<Class>,
        icalls: MutableSet<ICall>,
        propertiesReceiverType: TypeSpec.Builder
    ) {
        properties.forEach { property ->
            val propertySpec = property.generate(this, tree, icalls)
            if (propertySpec != null) {
                propertiesReceiverType.addProperty(propertySpec)

                val parameterType = property.type
                val parameterTypeName =
                    ClassName(if (parameterType.isCoreType()) "godot.core" else "godot", parameterType)

                if (property.hasValidSetter && parameterType.isCoreTypeAdaptedForKotlin()) {
                    val parameterName = property.name
                    val propertyFunSpec = FunSpec.builder(parameterName)

                    if (!isSingleton) {
                        if (tree.doAncestorsHaveProperty(this, property)) {
                            propertyFunSpec.addModifiers(KModifier.OVERRIDE)
                        } else {
                            propertyFunSpec.addModifiers(KModifier.OPEN)
                        }
                    }

                    propertyFunSpec
                        .addParameter(
                            ParameterSpec.builder(
                                "schedule",
                                LambdaTypeName.get(
                                    receiver = parameterTypeName,
                                    returnType = ClassName("kotlin", "Unit")
                                )
                            ).build()
                        )
                        .returns(parameterTypeName)
                        .addStatement(
                            """return $parameterName.apply{
                                                |    schedule(this)
                                                |    $parameterName = this
                                                |}
                                                |""".trimMargin()
                        )

                    propertiesReceiverType.addFunction(propertyFunSpec.build())
                }
            }
        }
    }

    private fun generateMethods(
        propertiesReceiverType: TypeSpec.Builder,
        tree: Graph<Class>,
        icalls: MutableSet<ICall>
    ) {
        methods.forEach { method ->
            propertiesReceiverType.addFunction(method.generate(this, tree, icalls))
        }
    }

    private fun generateToVariantMethod(propertiesReceiverType: TypeSpec.Builder) {
        val variantType = ClassName("godot.core", "Variant")
        propertiesReceiverType.addFunction(
            FunSpec.builder("toVariant")
                .returns(variantType)
                .addStatement("return %T(this)", variantType)
                .build()
        )
    }
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/Enum.kt
================================================
package godot.codegen

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import com.squareup.kotlinpoet.FunSpec
import com.squareup.kotlinpoet.TypeSpec


@JsonIgnoreProperties(ignoreUnknown = true)
class Enum @JsonCreator constructor(
    @JsonProperty("name")
    var name: String,
    @JsonProperty("values")
    var values: Map<String, Int>
) {

    val generated by lazy {
        val enumBuilder = TypeSpec.enumBuilder(name.escapeUnderscore())
        enumBuilder.primaryConstructor(
            FunSpec.constructorBuilder()
                .addParameter("id", Long::class)
                .addStatement("this.%N = %N", "id", "id")
                .build()
        )
        enumBuilder.addProperty("id", Long::class)
        values.forEach { (key, value) ->
            val valueName = if (name == "RPCMode") key.removePrefix("RPC_MODE_") else key
            enumBuilder.addEnumConstant(
                valueName, TypeSpec.anonymousClassBuilder()
                    .addSuperclassConstructorParameter("%L", value)
                    .build()
            )
        }
        val companion = TypeSpec.companionObjectBuilder()
            .addFunction(
                FunSpec.builder("from")
                    .addParameter("value", Long::class)
                    .addStatement("return values().single { it.%N == %N }", "id", "value")
                    .build()
            )
            .build()
        enumBuilder.addType(companion)
        enumBuilder.build()
    }
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/Graph.kt
================================================
package godot.codegen

class Graph<T>(elements: List<T>, sortFun: (T, T) -> Boolean) {
    val nodes = mutableListOf<Node<T>>()

    init {
        elements.forEach { nodes.add(Node(it)) }
        nodes.forEach { v1 ->
            nodes.forEach { v2 ->
                if (sortFun(v1.value, v2.value)) {
                    v2.childs.add(v1)
                    v1.parent = v2
                }
            }
        }
    }


    class Node<T>(val value: T) {
        var parent: Node<T>? = null
        var childs = mutableListOf<Node<T>>()
    }
}


fun List<Class>.buildTree(): Graph<Class> {
    return Graph(this) { child, parent -> child.baseClass == parent.newName }
}

fun Graph<Class>.getMethodFromAncestor(cl: Class, method: Method): Method? {
    fun check(m: Method): Boolean {
        if (m.newName == method.newName && m.arguments.size == method.arguments.size) {
            var flag = true

            m.arguments.withIndex().forEach {
                if (it.value.type != method.arguments[it.index].type) flag = false
            }

            if (flag) return true
        }
        return false
    }

    fun Graph.Node<Class>.findMethodInHierarchy(): Method? {
        value.methods.forEach {
            if (check(it)) return it
        }

        return parent?.findMethodInHierarchy()
    }
    return nodes.find { it.value.newName == cl.newName }?.parent?.findMethodInHierarchy()
}

fun Graph<Class>.doAncestorsHaveMethod(cl: Class, method: Method): Boolean {
    if (method.newName == "toString") return true

    if (cl.baseClass == "") return false

    return getMethodFromAncestor(cl, method) != null
}


fun Graph<Class>.doAncestorsHaveProperty(cl: Class, prop: Property): Boolean {
    if (cl.baseClass == "") return false

    fun Graph.Node<Class>.findPropertyInHierarchy(): Boolean {
        value.properties.forEach {
            if (it.name == prop.name) return true
        }
        return parent?.findPropertyInHierarchy() ?: false
    }
    return nodes.find { it.value.newName == cl.newName }!!.parent!!.findPropertyInHierarchy()
}

fun Graph<Class>.getSanitisedArgumentName(method: Method, index: Int, cl: Class): String {
    val parentMethod = getMethodFromAncestor(cl, method)
    return (parentMethod ?: method).arguments[index].name
}

fun Graph<Class>.isObjectOrItsChild(className: String): Boolean {
    var isObjectFamily = false
    var classToCheck = nodes.find { it.value.newName == className } ?: return false

    while (!isObjectFamily) {
        isObjectFamily = classToCheck.value.newName == "Object"

        if (isObjectFamily) return true

        classToCheck = classToCheck.parent ?: return false
    }
    return isObjectFamily
}

fun Graph<Class>.getBaseClass(clazz: Class): Class? = nodes.find { it.value.newName == clazz.baseClass }?.value


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/ICall.kt
================================================
package godot.codegen

import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy

class ICall(
    var returnType: String,
    private val arguments: List<Argument>
) {
    private val returnTypeClass = createReturnTypeClass()
    val name: String = createICallName()

    init {
        if (returnType.isEnum()) returnType = "Long"
    }

    private fun createICallName(): String {
        return buildString {
            append("_icall_${if (returnType.isEnum()) "Long" else returnType}")

            for (arg in arguments) {
                append('_')

                if (arg.nullable) {
                    append('n')
                }

                append(arg.type.convertTypeForICalls())
            }
        }
    }

    private fun createReturnTypeClass() = if (returnType == "VariantArray") {
        ClassName(
            returnType.getPackage(),
            returnType
        )
    } else {
        ClassName(
            if (returnType.isEnum()) "kotlin" else returnType.getPackage(),
            if (returnType.isEnum()) "Long" else returnType
        )
    }

    infix fun generateICall(tree: Graph<Class>): FunSpec {
        val spec = FunSpec
            .builder(name)
            .addModifiers(KModifier.INTERNAL)
            .addParameter(
                ParameterSpec(
                    "mb",
                    ClassName("kotlinx.cinterop", "CPointer")
                        .parameterizedBy(ClassName("godot.gdnative", "godot_method_bind"))
                )
            )
            .addParameter("inst", ClassName("kotlinx.cinterop", "COpaquePointer"))

        addArgumentsToICall(spec)


        val shouldReturn = returnType != "Unit"

        addReturnTypeForICall(shouldReturn, spec)
        generateICallMethodBlock(shouldReturn, spec, tree)

        return spec.build()
    }

    private fun generateICallMethodBlock(shouldReturn: Boolean, spec: FunSpec.Builder, tree: Graph<Class>) {
        val codeBlockBuilder = CodeBlock.builder()

        val isPrimitive = returnType.isPrimitive()

        if (shouldReturn) {
            if (isPrimitive) {
                spec.addStatement("var ret: %T = ${returnType.defaultValue()}", returnTypeClass)
                codeBlockBuilder.add("%M {\n", MemberName("kotlinx.cinterop", "memScoped"))
            } else {
                codeBlockBuilder.add("val ret = %M {\n", MemberName("kotlinx.cinterop", "memScoped"))
            }
        } else {
            codeBlockBuilder.add("%M {\n", MemberName("kotlinx.cinterop", "memScoped"))
        }

        if (shouldReturn) {
            if (isPrimitive) {
                codeBlockBuilder.add(
                    "    val retVar = %M<%T>()\n",
                    MemberName("kotlinx.cinterop", "alloc"),
                    ClassName("kotlinx.cinterop", "${returnType}Var")
                )
            } else {
                codeBlockBuilder.add(
                    "    val retVar = %M<%T>().ptr\n",
                    MemberName("kotlinx.cinterop", "alloc"),
                    if (returnType.isCoreType()) {
                        ClassName("godot.gdnative", "godot_${returnType.convertToSnakeCase()}")
                    }
                    else ClassName("kotlinx.cinterop", "COpaquePointerVar")
                )
            }
        }

        codeBlockBuilder.add(
                "    val args = %M<%T>(${arguments.size + 1})\n",
                MemberName("kotlinx.cinterop", "allocArray"),
                ClassName("kotlinx.cinterop", "COpaquePointerVar")
            )
        arguments.withIndex().forEach {
            val i = it.index
            val value = it.value
            val nullInstruction = if (value.nullable) "?" else ""
            when {
                value.type == "String" -> {
                    codeBlockBuilder.add(
                        "    args[$i] = arg$i$nullInstruction.%M()$nullInstruction.value$nullInstruction.ptr\n",
                        MemberName("godot.core", "toGDString")
                    )
                }
                value.type == "VariantArray" || value.type == "Variant" -> {
                    codeBlockBuilder.add(
                        "    args[$i] = arg$i$nullInstruction._handle$nullInstruction.ptr\n"
                    )
                }
                value.type.isCoreType() -> {
                    codeBlockBuilder.add(
                        "    args[$i] = arg$i$nullInstruction.getRawMemory(this)\n"
                    )
                }
                value.type.isPrimitive() -> {
                    codeBlockBuilder.add(
                        "    args[$i] = arg$i.%M(this)\n",
                        MemberName("godot.internal.type", "getRawMemory")
                    )
                }
                else -> {
                    codeBlockBuilder.add(
                        "    args[$i] = arg$i$nullInstruction.ptr\n"
                    )
                }
            }
        }
        codeBlockBuilder.add("    args[${arguments.size}] = null\n")

        if (shouldReturn) {
            if (isPrimitive) {
                codeBlockBuilder.add(
                    "    %T.gdnative.godot_method_bind_ptrcall!!.%M(mb, inst, args, retVar.%M)\n",
                    ClassName("godot.core", "Godot"),
                    MemberName("kotlinx.cinterop", "invoke"),
                    MemberName("kotlinx.cinterop", "ptr")
                )
                destroyStringArgs(codeBlockBuilder)
                codeBlockBuilder.add(
                    "    ret = retVar.%M\n",
                    MemberName("kotlinx.cinterop", "value")
                )
            } else {
                codeBlockBuilder.add(
                    "    %T.gdnative.godot_method_bind_ptrcall!!.%M(mb, inst, args, retVar)\n",
                    ClassName("godot.core", "Godot"),
                    MemberName("kotlinx.cinterop", "invoke")
                )
                destroyStringArgs(codeBlockBuilder)
                val returnTypeClassSimpleName = returnTypeClass.simpleName

                when {
                    tree.isObjectOrItsChild(returnTypeClassSimpleName) -> {
                        val typeManagerClass = ClassName("godot.core", "TypeManager")
                        if (returnTypeClassSimpleName != "Object") {
                            codeBlockBuilder.add(
                                "    %M(retVar.pointed.value!!) as %T\n",
                                MemberName(typeManagerClass, "wrap"),
                                returnTypeClass
                            )
                        } else {
                            codeBlockBuilder.add(
                                "    %M(retVar.pointed.value!!)\n",
                                MemberName(typeManagerClass, "wrap")
                            )
                        }
                    }

                    returnTypeClassSimpleName == "String" -> {
                        codeBlockBuilder.add(
                            "    %M(retVar).toKString()\n",
                            MemberName("godot.core", "GdString")
                        )
                    }

                    else -> {
                        codeBlockBuilder.add(
                            "    %T(retVar)\n",
                            returnTypeClass
                        )
                    }
                }
            }
        } else {
            codeBlockBuilder.add(
                "    %T.gdnative.godot_method_bind_ptrcall!!.%M(mb, inst, args, null)\n",
                ClassName("godot.core", "Godot"),
                MemberName("kotlinx.cinterop", "invoke")
            )
            destroyStringArgs(codeBlockBuilder)
        }

        codeBlockBuilder.add("}\n")

        if (shouldReturn) {
            codeBlockBuilder.add("return ret")
        }

        spec.addCode(codeBlockBuilder.build())
    }

    private fun addReturnTypeForICall(shouldReturn: Boolean, spec: FunSpec.Builder) {
        if (shouldReturn) {
            spec.returns(returnTypeClass)
        }
    }

    private fun addArgumentsToICall(spec: FunSpec.Builder) {
        arguments.withIndex().forEach {
            val argument = it.value
            val argumentTypeAsString = argument.type.convertTypeForICalls()
            var argumentType: TypeName = ClassName(argumentTypeAsString.getPackage(), argumentTypeAsString)

            if (argument.nullable) {
                argumentType = argumentType.copy(nullable = true)
            }

            spec.addParameter("arg${it.index}", argumentType)
        }
    }

    private fun destroyStringArgs(codeBlockBuilder: CodeBlock.Builder) = arguments.withIndex().forEach {
        if (it.value.type == "String") {
            codeBlockBuilder.add(
                "    %M(args[${it.index}]!!).destroy(this)\n",
                MemberName("godot.core", "GdString")
            )
        }
    }

    override fun equals(other: Any?): Boolean {
        if (other !is ICall) return false

        return this.name == other.name
    }

    override fun hashCode(): Int {
        return name.hashCode()
    }
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/Method.kt
================================================
package godot.codegen

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import com.squareup.kotlinpoet.*


@JsonIgnoreProperties(ignoreUnknown = true)
open class Method @JsonCreator constructor(
    @JsonProperty("name")
    val oldName: String,
    @JsonProperty("return_type")
    var returnType: String,
    @JsonProperty("is_virtual")
    val isVirtual: Boolean,
    @JsonProperty("has_varargs")
    val hasVarargs: Boolean,
    @JsonProperty("arguments")
    val arguments: List<Argument>
) {

    val newName: String

    init {
        newName = oldName.convertToCamelCase()
        returnType = returnType.convertTypeToKotlin()
    }

    var isGetterOrSetter: Boolean = false

    fun generate(clazz: Class, tree: Graph<Class>, icalls: MutableSet<ICall>): FunSpec {
        // Uncomment to disable method implementation generation
        //if (isGetterOrSetter) return null
        val modifiers = mutableListOf<KModifier>()

        if (!clazz.isSingleton) {
            modifiers.add(getModifier(tree, clazz))
        }

        val generatedFunBuilder = FunSpec
            .builder(newName)
            .addModifiers(modifiers)

        val shouldReturn = returnType != "Unit"
        if (shouldReturn) {
            val simpleName = returnType.removeEnumPrefix()
            val returnClassName = ClassName(returnType.getPackage(), simpleName)
            generatedFunBuilder.returns(returnClassName)
        }

        if (returnType.isEnum()) {
            val type = returnType.removeEnumPrefix()
            if (type.contains('.')) {
                clazz.additionalImports.add(returnType.getPackage() to type.split('.')[0])
            }
        }

        //TODO: move adding arguments to generatedFunBuilder to separate function
        val callArgumentsAsString = buildCallArgumentsString(
            tree,
            clazz,
            generatedFunBuilder
        ) //cannot be inlined as it also adds the arguments to the generatedFunBuilder

        if (hasVarargs) {
            generatedFunBuilder.addParameter(
                "__var_args",
                Any::class.asTypeName().copy(nullable = true),
                KModifier.VARARG
            )
        }

        if (!isVirtual) {
            generatedFunBuilder.addStatement("val mb = %M(\"${clazz.oldName}\",\"${oldName}\")", MemberName("godot.internal.utils", "getMethodBind"))
            val constructedICall = constructICall(callArgumentsAsString, icalls)
            generatedFunBuilder.addStatement(
                "%L%L%M%L%L",
                if (shouldReturn) "return " else "",
                when {
                    returnType == "enum.Error" -> {
                        "${returnType.removeEnumPrefix()}.byValue( "
                    }
                    returnType.isEnum() -> {
                        "${returnType.removeEnumPrefix()}.from( "
                    }
                    hasVarargs && returnType != "Variant" && returnType != "Unit" -> {
                        "$returnType from "
                    }
                    else -> {
                        ""
                    }
                },
                MemberName("godot.icalls", constructedICall.first),
                constructedICall.second,
                when {
                    returnType == "enum.Error" -> ".toUInt())"
                    returnType.isEnum() -> ")"
                    else -> ""
                }
            )
        } else {
            if (shouldReturn) {
                generatedFunBuilder.addStatement(
                    "%L %T(%S)",
                    "throw",
                    NotImplementedError::class,
                    "$oldName is not implemented for ${clazz.newName}"
                )
            }
        }
        return generatedFunBuilder.build()
    }

    private fun buildCallArgumentsString(tree: Graph<Class>, cl: Class, generatedFunBuilder: FunSpec.Builder): String {
        return buildString {
            arguments.withIndex().forEach {
                val index = it.index
                val argument = it.value

                if (index != 0 || !hasVarargs) append(", ")

                val sanitisedName = tree.getSanitisedArgumentName(this@Method, index, cl)
                append(sanitisedName)

                if (argument.type.isEnum()) append(".id")

                val parameterBuilder = ParameterSpec.builder(
                    argument.name,
                    ClassName(
                        argument.type.getPackage(),
                        argument.type.removeEnumPrefix()
                    ).copy(nullable = argument.nullable)
                )

                if (argument.applyDefault != null) parameterBuilder.defaultValue(argument.applyDefault)

                generatedFunBuilder.addParameter(parameterBuilder.build())
            }
            if (hasVarargs && !isEmpty()) append(", ")
        }
    }

    private fun getModifier(tree: Graph<Class>, cl: Class) =
        if (tree.doAncestorsHaveMethod(cl, this)) KModifier.OVERRIDE else KModifier.OPEN

    private fun constructICall(methodArguments: String, icalls: MutableSet<ICall>): Pair<String, String> {
        if (hasVarargs) {
            return "_icall_varargs" to
                "( mb, this.ptr, " +
                if (methodArguments.isNotEmpty()) "arrayOf($methodArguments*__var_args))" else "__var_args)"
        }

        val icall = ICall(returnType, arguments)
        icalls.add(icall)
        return icall.name to "( mb, this.ptr$methodArguments)"
    }
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/Property.kt
================================================
package godot.codegen

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import com.squareup.kotlinpoet.*


@JsonIgnoreProperties(ignoreUnknown = true)
class Property @JsonCreator constructor(
    @JsonProperty("name")
    var name: String,
    @JsonProperty("type")
    var type: String,
    @JsonProperty("getter")
    var getter: String,
    @JsonProperty("setter")
    var setter: String,
    @JsonProperty("index")
    val index: Int
) {
    var hasValidGetter: Boolean = false
    lateinit var validGetter: Method

    var hasValidSetter: Boolean = false
    lateinit var validSetter: Method

    init {
        name = name.convertToCamelCase()
        type = type.convertTypeToKotlin()

        getter = getter.convertToCamelCase()
        setter = setter.convertToCamelCase()

        name = name.replace('/', '_')

        // There are property with multiple types, and it's all Materials, so
        // Godot's developer should make more strict API
        if (type.indexOf(",") != -1) {
            type = "Material"
        }
    }

    fun generate(clazz: Class, tree: Graph<Class>, icalls: MutableSet<ICall>): PropertySpec? {
        if (!hasValidGetter && !hasValidSetter) return null

        if (hasValidGetter && !validGetter.returnType.isEnum() && type != validGetter.returnType) {
            type = validGetter.returnType
        }

        // Sorry for this, CPUParticles has "scale" property overrides ancestor's "scale", but mismatches type
        if (clazz.newName == "CPUParticles" && name == "scale") name = "_scale"

        val modifiers = mutableListOf<KModifier>()
        if (!clazz.isSingleton) {
            modifiers.add(if (tree.doAncestorsHaveProperty(clazz, this)) KModifier.OVERRIDE else KModifier.OPEN)
        }

        val propertyType = ClassName(type.getPackage(), type)
        val propertySpecBuilder = PropertySpec
            .builder(
                name,
                propertyType,
                modifiers
            )

        if (hasValidSetter) {
            propertySpecBuilder.mutable()
            val icall = if (index != -1) {
                ICall("Unit", listOf(Argument("idx", "Long"), Argument("value", type)))
            } else {
                ICall("Unit", listOf(Argument("value", type)))
            }
            icalls.add(icall)
            propertySpecBuilder.setter(
                FunSpec.setterBuilder()
                    .addParameter("value", propertyType)
                    .addStatement("val mb = %M(\"${clazz.oldName}\",\"${validSetter.oldName}\")", MemberName("godot.internal.utils", "getMethodBind"))
                    .addStatement(
                        "%M(mb, this.ptr${if (index != -1) ", $index, value)" else ", value)"}",
                        MemberName("godot.icalls", icall.name)
                    )
                    .build()
            )
        }

        if (hasValidGetter) {
            val icall = if (index != -1) {
                ICall(type, listOf(Argument("idx", "Long")))
            } else {
                ICall(type, listOf())
            }
            icalls.add(icall)
            propertySpecBuilder.getter(
                FunSpec.getterBuilder()
                    .addStatement("val mb = %M(\"${clazz.oldName}\",\"${validGetter.oldName}\")", MemberName("godot.internal.utils", "getMethodBind"))
                    //Hard to maintain but do not see how to do better (Pierre-Thomas Meisels)
                    .addStatement(
                        "return %M(mb, this.ptr${if (index != -1) ", $index)" else ")"}",
                        MemberName("godot.icalls", icall.name)
                    )
                    .build()
            )
        } else {
            propertySpecBuilder.getter(
                FunSpec.getterBuilder()
                    .addStatement(
                        "%L %T(%S)",
                        "throw",
                        UninitializedPropertyAccessException::class,
                        "Cannot access property $name: has no getter"
                    )
                    .build()
            )
        }

        return propertySpecBuilder.build()
    }

    infix fun applyGetterOrSetter(method: Method) {
        if (name == "") return

        when (method.newName) {
            getter -> {
                if (method.returnType == "Unit" || method.arguments.size > 1 || method.isVirtual) return

                if (index == -1 && method.arguments.size == 1) return

                if (method.arguments.size == 1 && method.arguments[0].type != "Long") return

                validGetter = method
                hasValidGetter = true
                method.isGetterOrSetter = true
            }
            setter -> {
                if (method.returnType != "Unit" || method.arguments.size > 2 || method.isVirtual) return

                if (index == -1 && method.arguments.size == 2) return

                if (method.arguments.size == 2 && method.arguments[0].type != "Long") return

                validSetter = method
                hasValidSetter = true
                method.isGetterOrSetter = true
            }
        }
    }
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/Signal.kt
================================================
package godot.codegen

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.MemberName
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
import com.squareup.kotlinpoet.PropertySpec


@JsonIgnoreProperties(ignoreUnknown = true)
class Signal @JsonCreator constructor(
    @JsonProperty("name")
    var name: String,
    @JsonProperty("arguments")
    val arguments: List<SignalArgument>
) {

    val generated: PropertySpec
        get() {
            val builder = if (arguments.isEmpty()) {
                PropertySpec
                    .builder(
                        name.convertToCamelCase().escapeKotlinReservedNames(),
                        ClassName("godot.core", "Signal0")
                    )
                    .delegate(
                        "%M()",
                        MemberName("godot.core", "signal")
                    )
            } else {
                PropertySpec
                    .builder(
                        name.convertToCamelCase().escapeKotlinReservedNames(),
                        ClassName("godot.core", "Signal${arguments.size}")
                            .parameterizedBy(*arguments.map { ClassName(it.type.getPackage(), it.type) }.toTypedArray())
                    )
                    .delegate("%M(${
                        arguments
                            .map { "\"${it.name}\"" + if (it != arguments.last()) ", " else "" }
                            .reduce { acc, s -> acc + s }
                    })",
                        MemberName("godot.core", "signal")
                    )
            }
            return builder.build()
        }
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/SignalArgument.kt
================================================
package godot.codegen

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty


@JsonIgnoreProperties(ignoreUnknown = true)
class SignalArgument @JsonCreator constructor(
    @JsonProperty("name")
    val name: String,
    @JsonProperty("type")
    var type: String,
    @JsonProperty("default_value")
    val defaultValue: String
) {
    init {
        type = type.convertTypeToKotlin()
    }
}


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/TypeCast.kt
================================================
package godot.codegen

private val coreTypes = listOf(
    "VariantArray",
    "Basis",
    "Color",
    "Dictionary",
    "GodotError",
    "NodePath",
    "Plane",
    "PoolByteArray",
    "PoolIntArray",
    "PoolRealArray",
    "PoolStringArray",
    "PoolVector2Array",
    "PoolVector3Array",
    "PoolColorArray",
    "PoolIntArray",
    "PoolRealArray",
    "Quat",
    "Rect2",
    "AABB",
    "RID",
    "String",
    "Transform",
    "Transform2D",
    "Variant",
    "Vector2",
    "Vector3"
)

private val coreTypeAdaptedForKotlin =
    listOf("AABB", "Basis", "Color", "Plane", "Quat", "Rect2", "Transform", "Transform2D", "Vector2", "Vector3")

private val kotlinReservedNames = listOf(
    "class",
    "enum",
    "interface",
    "in",
    "var",
    "val",
    "Char",
    "Short",
    "Boolean",
    "Int",
    "Long",
    "Float",
    "Double",
    "operator",
    "object"
)

private val primitives = listOf("Long", "Double", "Boolean", "Unit")

fun String.escapeUnderscore(): String {
    if (this == "") return this

    var thisString = this

    while (thisString[0] == '_') thisString = thisString.drop(1)

    return thisString
}

fun String.removeEnumPrefix(): String {
    if (this == "") return this

    var thisString = this

    val ind = thisString.indexOf("enum.")
    if (ind != -1) thisString = thisString.drop(ind + 5)

    if (thisString == "Error") return "GodotError"

    return thisString.replace("::", ".").escapeUnderscore()
}

fun String.getPackage() =
    when {
        isEnum() -> {
            var thisString = this
            val index = thisString.indexOf("enum.")

            if (index != -1) thisString = thisString.drop(index + 5)

            if (thisString == "Error") {
                "godot.core"
            } else {
                thisString = thisString.replace("::", ".").split(".")[0]
                when {
                    thisString.isPrimitive() || thisString == "String" -> "kotlin"
                    thisString.isCoreType() -> "godot.core"
                    else -> "godot"
                }
            }
        }
        isPrimitive() || this == "String" -> "kotlin"
        isCoreType()  -> "godot.core"
        else -> "godot"
    }

fun String.isEnum(): Boolean {
    return this.indexOf("enum.") == 0
}

fun String.isPrimitive() = primitives.find { s -> s == this } != null

fun String.isCoreTypeAdaptedForKotlin() = coreTypeAdaptedForKotlin.find { s -> s == this } != null

fun String.isCoreType() = coreTypes.find { s -> s == this } != null

fun String.escapeKotlinReservedNames() = if (kotlinReservedNames.find { s -> s == this } != null) "_$this" else this

fun String.convertToCamelCase(): String {
    if (this == "") return this

    var thisString = this

    val prefix = buildString {
        while (thisString != "" && thisString[0] == '_') {
            this.append('_')
            thisString = thisString.drop(1)
        }
    }

    var split = thisString.split('_')
    val first = split[0]
    split = split.drop(1)

    return prefix + first + split.joinToString("") { it.capitalize() }
}

fun String.convertToSnakeCase(): String =
    if (this == "VariantArray") "array"
    else if (this == "AABB" || this == "RID" || this == "Transform2D") this.toLowerCase()
    else fold(StringBuilder()) { accumulator, character ->
        if (character in 'A'..'Z')
            (if (accumulator.isNotEmpty()) accumulator.append('_') else accumulator)
            .append(character + ('a' - 'A'))
        else accumulator.append(character)
    }.toString()

fun String.convertTypeToKotlin(): String {
    return when {
        this == "int" -> "Long"
        this == "float" -> "Double"
        this == "bool" -> "Boolean"
        this == "void" -> "Unit"
        this == "Array" -> "VariantArray"
        else -> this
    }
}

fun String.convertTypeForICalls(): String {
    if (this == "enum.Error") return "UInt"

    if (this.isEnum()) return "Long"

    if (this.isPrimitive() || this.isCoreType()) return this

    return "Object"
}


fun String.defaultValue(): String = when (this) {
    "Long" -> "0"
    "Double" -> "0.0"
    "Boolean" -> "false"
    else -> throw Exception("$this is not a primitive type.")
}

private class TypeException(override val message: String) : Exception()


================================================
FILE: buildSrc/src/main/kotlin/godot/codegen/generationEntry.kt
================================================
package godot.codegen

import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.ObjectMapper
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
import java.io.File


infix fun File.generateApiFrom(jsonSource: File) {
    val classes: List<Class> = ObjectMapper().readValue(jsonSource, object : TypeReference<ArrayList<Class>>() {})

    val tree = classes.buildTree()
    val icalls = mutableSetOf<ICall>()

    classes.forEach { clazz ->
        clazz.generate(this, tree, icalls)
    }

    val iCallFileSpec = FileSpec
        .builder("godot.icalls", "__icalls")
        .addFunction(generateICallsVarargsFunction())
        .addImport("kotlinx.cinterop", "set", "get", "pointed")

    icalls.forEach { iCallFileSpec.addFunction(it generateICall tree) }

    this.parentFile.mkdirs()

    iCallFileSpec
        .addComment("THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD")
        .build()
        .writeTo(this)

    generateEngineTypesRegistration(classes).writeTo(this)
}

private fun generateICallsVarargsFunction(): FunSpec {
    return FunSpec
        .builder("_icall_varargs")
        .addModifiers(KModifier.INTERNAL)
        .returns(ClassName("godot.core", "Variant"))
        .addParameter(
            "mb",
            ClassName("kotlinx.cinterop", "CPointer")
                .parameterizedBy(ClassName("godot.gdnative", "godot_method_bind"))
        )
        .addParameter(
            "inst",
            ClassName("kotlinx.cinterop", "COpaquePointer")
        )
        .addParameter(
            "arguments",
            ClassName("kotlin", "Array").parameterizedBy(STAR)
        )
        .addStatement(
            """return %M {
                            |    val args = %M<%T<%M>>(arguments.size)
                            |    for ((i,arg) in arguments.withIndex()) args[i] = %T.wrap(arg)._handle.ptr
                            |    val result = %T.gdnative.godot_method_bind_call!!.%M(mb, inst, args, arguments.size, null)
                            |    for (i in arguments.indices) %T.gdnative.godot_variant_destroy!!.%M(args[i])
                            |    %T(result)
                            |}
                            |""".trimMargin(),
            MemberName("kotlinx.cinterop", "memScoped"),
            MemberName("kotlinx.cinterop", "allocArray"),
            ClassName("kotlinx.cinterop", "CPointerVar"),
            MemberName("godot.gdnative", "godot_variant"),
            ClassName("godot.core", "Variant"),
            ClassName("godot.core", "Godot"),
            MemberName("kotlinx.cinterop", "invoke"),
            ClassName("godot.core", "Godot"),
            MemberName("kotlinx.cinterop", "invoke"),
            ClassName("godot.core", "Variant")
        )
        .build()
}

private fun generateEngineTypesRegistration(classes: List<Class>): FileSpec {
    val funBuilder = FunSpec.builder("registerEngineTypes")
        .addModifiers(KModifier.INTERNAL)
        .receiver(ClassName("godot.core", "TypeManager"))

    classes.filter { !it.isSingleton && it.newName != "Object" && it.shouldGenerate}.forEach {
        funBuilder.addStatement(
            "registerEngineType(%S, ::%T)",
            it.newName,
            ClassName(it.newName.getPackage(), it.newName)
        )
    }
    return FileSpec.builder("godot", "registerEngineTypes")
        .addFunction(
            funBuilder.build()
        )
        .build()
}


================================================
FILE: buildSrc/src/main/kotlin/godot/tasks/GenerateApiTask.kt
================================================
package godot.tasks

import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import godot.codegen.generateApiFrom

open class GenerateApiTask : DefaultTask() {

    @InputFile
    val source = project.objects.fileProperty()

    @OutputDirectory
    val outputDirectory = project.objects.directoryProperty()

    @TaskAction
    fun generateAPI() {
        // First, we clear output directory
        outputDirectory.get().asFile.deleteRecursively()
        outputDirectory.asFile.get() generateApiFrom source.asFile.get()
    }
}


================================================
FILE: buildSrc/src/main/kotlin/os.kt
================================================
import org.gradle.internal.os.OperatingSystem

enum class OS {
    LINUX,
    MACOS,
    WINDOWS
}

val currentOS by lazy {
    val current = OperatingSystem.current()
    when {
        current.isLinux -> OS.LINUX
        current.isMacOsX -> OS.MACOS
        current.isWindows -> OS.WINDOWS
        else -> throw AssertionError("Unsupported os: ${current.name}")
    }
}


================================================
FILE: design-docs/ABOUT.md
================================================
This folder contains decisions we made and why we made them.
It exists for us to remember why we made a certain decision and for new contributors to better understand how the binding works and we certain things are the way they are.

Contents:
- [Dictionary](dictionary.md)

================================================
FILE: design-docs/dictionary.md
================================================
This is an example of how pages inside this category might look like:

---

## Criteria

The next section list down several `Dictionary` implementations, sighting how it compares to a `kotlin.MutableMap` - specifically in the following key areas:

1. Setting a value
2. Getting a value
3. Iteration.



Additionally, it will also compare the implementation to how a `Dictionary` is used in GDScript.



## Implementations



### [1] Using Variant and specialized methods  (current)

```kotlin
class Dictionary : Iterable<Map.Entry<Variant, Variant>> {
    fun set(key: Long, value: Long)
    fun set(key: Long, value: Double)
    // and so on
    fun set(key: String, value: Long)
    fun set(key: String, value: Double)
    // and so on
    
    fun get(key: Long): Variant
    fun get(key: String): Variant
    // and so on
}
```

The idea behind this implementation is to prevent the user from passing on a *wrong value type* to the `Dictionary` by providing specialized methods that only accept the correct value types. *wrong value type*s are either types that can't be converted to a  `Variant` or types that when passed to a `Variant` losses it's type identity - an example of this are the `Int` and `Float` types as `Variant` only work with the mentioned type's wider cousins: `Long` and `Double`, respectively. When creating a `Variant` from an `Int`, the value will be converted to a `Long` first before storing it - so when unwrapping the value from the `Variant` it's impossible to know if the initial value passed to it was an `Int` or a `Long`.

**Setting a value**

```kotlin
dic[1L] = 2L
dic["hello"] = 0.5
dic[1] = "hi" // does not compile, key here is an Int
dic["foo"] = 0.1f // does not compile, value here is a Float
dic[SomeKotlinClass()] = 2L // does not compile as SomeKotlinClass is not Variant compatible
```

In this area, setting a value is similar with `kotlin.MutableMap`.

**Getting a value**

```kotlin
dic["hello"].asString() // returns a variant, use asXXX to convert it to the expected type
dic.get("hello", 1L) // returns a Long value with a default of 1L if not present
```

In a way the second line is similar to how a `kotlin.MutableMap` works, however in the first line you to deal with a `Variant` first then convert it to the expected type. 

**Iteration**

```kotlin
dic.forEach { (keyAsVariant, valueAsVariant) ->
	// do something here
}

for ((keyAsVariant, valueAsVariant) in dic) {
    // do something here
}
```

It is almost similar to `kotlin.MutableMap` however the biggest downside is you have to deal with `Variant`s.

**GDScript comparison**

```kotlin
dic[1] = 2
dic["hello"] = 0.5
dic[1] = "hi"
dic["foo"] = 0.1

print(dic["Hello"]) // no explicit Variant conversion.
```

Everything is a `Variant` in GDScript, but the type itself is not exposed to users - but they are automatically converted. The problems with `Int` and `Float` is not present here because GDScript is using `Long` and `Double` for natural and real  numbers, respectively. If you think about it a `Variant` in Kotlin parlance is `Any`, while in C# it is an `object`.



### [2] Dictionary extending AbstractMutableMap<Any, Any>

```kotlin
class Dictionary : AbstractMutableMap<Any, Any>() {
    // ...
}
```

This is inspired by Godot C#, essentially `Dictionary` is a `IMap<object, object>`. The idea behind this implementation is to make usage of `Dictionary` idiomatic in Kotlin but retains its behaviour in GDScript (i.e, You can assign any key and value - as long as they are `Variant` compatible). A big bonus we get here is that we can use all the API defined for `kotlin.MutableMap`.

**Setting a value**

```kotlin
dic[1L] = 2L
dic["hello"] = 0.5
dic[1] = "hi" // compiles but the type of they key when queried will be a Long (1)
dic["foo"] = 0.1f // compiles but the type of the value when queried will be a Double (2)
dic[SomeKotlinClass()] = 2L // compiles but fails at runtime because SomeKotlinClass is not Variant compatible (3)
```

In a way it's similar to the first implementation except for the last three lines: (1) and (2) will lose the type information of it's key and value, respectively - but alternatively we can change the behaviour to throw an exception at runtime  in a [fail-fast](https://en.wikipedia.org/wiki/Fail-fast) manner. Failing fast here means the user can pick up the mistake during development instead of discovering it after the code has been shipped.

**Getting a value**

```kotlin
dic["hello"] as String // explicit casting to a String
dic.getOrDefault("Hello", 0) // returns an Int, via implicit casting.
```

Since values are `Any`, we have to cast to the appropriate type. This is similar to the first implementation, but doesn't use a `Variant` which in my honest opinion - shouldn't be used by users (It's not exposed in GDScript and C# - why should we? In C# it is only used to namespace: `Variant.Type` and `Variant.OP`: https://godotsharp.net/api/3.1.0/Godot.Variant/)

**Iteration**

```kotlin
dic.forEach { (keyAsAny, valueAsAny) ->
	// do something here
}

for ((keyAsAny, valueAsAny) in dic) {
    // do something here
}
```

Again, similar to the first implementation but not using `Variant`.

**GDScript Comparison**

This has a lot of similarity with GDScript, specifically setting a value. The difference lies in retrieving the value, you have to cast to the expected type in Kotlin due to it being statically typed. Ignoring the difference in typing nature of Kotlin and GDScript, this implementation is equal to the GDScript one.



### [3] Typed Dictionary

```kotlin
class Dictionary<K: Any, V: Any> : AbstractMutableMap<K, V>() {
    // ...
}
```

This approach is a specialization of the second implementation where we allow users to specify more information about the types of its keys and values. This is the most idiomatic compared to the two previous implementation, essentially what you have here is a `kotlin.MutableMap` with a different name. One of the downside of this approach is that it's impossible to prevent users from using types that are not `Variant` compatible (i.e.`Dictionary<Throwable, SomeKotlinClass>`).

**Setting a value**

```kotlin
val dic: Dictionary<String, Int> = ...
dic["Hello"] = 12
dic["Foo"] = true // does not compile, dic can only store Ints values
dic[1] = 12 // does not compile, dic can only use String keys

val dic: Dictionary<Any, Any> = ...
dic["Foo"] = true // works!
dic[1] = 12 // works!
```

This approach allows you to restrict the type you can pass as its keys and values. If you want a `Dictionary` which behaves similarly in GDScript, then you can declare it as `Dictionary<Any, Any>`.

**Getting a value**

```kotlin
val dic: Dictionary<String, Int> = ...
var a = dic["Hello"] + 1 // works!
```

This is the area where this approach shines, you don't have to do any explicit casting to the expected type unless you declared it as `Dictionary<Any, Any>`.

**Iteration**

```kotlin
val dic: Dictionary<String, Int> = ...
dic.forEach { (key, value) ->
	// do something here
}

for ((key, value) in dic) {
    // do something here
}
```

As mentioned in the previous section, this approach shines in reads - no more explicit casting to the expected type.

**GDScript Comparison**

This is very different to GDScript but it is more idiomatic in Kotlin. It is hard to compare how reads are done in both languages due to the difference in typing.


================================================
FILE: docs/.gitignore
================================================
site/
p3/

================================================
FILE: docs/SUMMARY.md
================================================
* [Overview](src/doc/index.md)
* [API differences](src/doc/api-differences.md)
* [Supported platforms](src/doc/supported-platforms.md)
* [Setting up]()
    * [Gradle](src/doc/setup/gradle.md)
    * [IDE](src/doc/setup/ide.md)
* [User guide]()
    * [Classes](src/doc/user-guide/classes.md)
    * [Methods](src/doc/user-guide/methods.md)
    * [Signals](src/doc/user-guide/signals.md)
    * [Properties](src/doc/user-guide/properties.md)
* [Contribution](src/doc/contribution.md)


================================================
FILE: docs/build.sh
================================================
#! /usr/bin/env bash
set -e
BASEDIR=$(dirname "$0")
VIRTUALENV_DIR="$BASEDIR/p3"

if [[ ! -d "$VIRTUALENV_DIR" ]]; then
    pip install virtualenv
    virtualenv -p python3 "$VIRTUALENV_DIR"
    source "$VIRTUALENV_DIR/bin/activate"
    pip install -r requirements.txt
fi
mkdocs build

================================================
FILE: docs/mkdocs.yml
================================================
site_name: Kotlin Native binding for Godot
docs_dir: src/doc

repo_name: 'utopia-rise/godot-kotlin'
repo_url: 'https://github.com/utopia-rise/godot-kotlin'

theme:
  name: material
  favicon: assets/img/favicon.ico
  palette:
    primary: indigo
    accent: light-blue
  logo: assets/img/logo.png

extra:
  social:
    - type: 'github'
      link: 'https://github.com/utopia-rise'

markdown_extensions:
  - codehilite:
      linenums: true
  - pymdownx.inlinehilite
  - admonition


nav:
  - Overview: index.md
  - API differences: api-differences.md
  - Supported platforms: supported-platforms.md
  - Setting up:
      - Gradle: setup/gradle.md
      - IDE: setup/ide.md
  - User guide:
    - Classes: user-guide/classes.md
    - Methods: user-guide/methods.md
    - Signals: user-guide/signals.md
    - Properties: user-guide/properties.md
  - Contribution: contribution.md


================================================
FILE: docs/requirements.txt
================================================
mkdocs-material==4.6.0
mkdocs==1.0.4


================================================
FILE: docs/run.sh
================================================
#! /usr/bin/env bash
set -e
BASEDIR=$(dirname "$0")
VIRTUALENV_DIR="$BASEDIR/p3"

if [[ ! -d "$VIRTUALENV_DIR" ]]; then
    pip install virtualenv
    virtualenv -p python3 "$VIRTUALENV_DIR"
    source "$VIRTUALENV_DIR/bin/activate"
    pip install -r requirements.txt
else
  source "$VIRTUALENV_DIR/bin/activate"
fi
mkdocs serve

================================================
FILE: docs/src/doc/api-differences.md
================================================
## Instance types and singletons
Creating a new instance of a Godot type can be done like any Kotlin types.

```kotlin
val spatial = Spatial()
val vec = Vector3()
```

Godot singletons are mapped as Kotlin objects.

```kotlin
Physics2DServer.areaGetTransform(area)
```

## Core types
Godot's built-in types are passed by value (except for `Dictionary` and `VariantArray` - more on this later), so the following snippet won't work as expected.

```kotlin
val spatial = Spatial()
spatial.rotation.y += 10f
```

You are actually mutating a copy of the `rotation` property, not a reference to it. To get the desired behaviour you have to re-assign the copy back. 

```kotlin
val rotation = spatial.rotation
rotation.y += 10f
spatial.rotation = rotation
``` 

This approach introduces a lot of boilerplate, so this binding provides a concise way of achieving the same behaviour.

```kotlin
spatial.rotation {
  y += 10f
}
```

The snippet above is functionally equivalent to the previous one.

## Collection types
While `VariantArray` and `Dictionary` are passed by reference, the value returned by the retrieval methods (`VariantArray.get(...)` and `Dictionary.get(...)`) are not.

```kotlin
array.get(index).asVector3().y += 10f
dictionary.get("foo").asVector3().y += 5f
```

To get the desired behaviour, you can re-assign the copy back or in a similar fashion as before, this binding provides a better alternative.

```kotlin
array.get<Vector3>(index) {
  y += 10f
}

dictionary.get<Vector3>(index) {
  y += 5f
}
``` 

## Enums and constants
Godot enums are mapped to Kotlin enums, the generated enum exposes a `value` property that represents the value in Godot. Constants in Godot classes that represent an enum value (such as `Node.PAUSE_MODE_INHERIT`) are not present in this binding, please use the generated enum instead (`Node.PauseMode.INHERIT`).

## Signals and exposed methods
In GDScript, signals and methods can have any number of arguments, this is not possible in Kotlin as it is a statically typed language. At the moment, you can create signals and expose methods to Godot with at most 10 parameters.

Additionally, signals are mapped to properties of type `Signal` and must start with a prefix `signal` (check [Signals](user-guide/signals.md) section for more details). The prefix is dropped during registration, so the signal `signalReverseChanged` is known in Godot as `reverse_changed`. This is done to avoid naming conflicts with other members of a class. There is no signal type in GDScript, signals are only referenced by name so they can have the same name as methods and/or properties in the same class. 

## Renamed symbols
To avoid confusion and conflict with Kotlin types, the following Godot symbols are renamed.

- `Array` -> `VariantArray` (to avoid confusion with a built-in type in Kotlin)
- `PoolRealArray` -> `PoolFloatArray` (for naming consistency)
- `Variant.asReal()` -> `Variant.asFloat()` (for naming consistency)

================================================
FILE: docs/src/doc/contribution.md
================================================

We encourage you to contribute to the project if you want. Even if you don't have any idea how the binding works or if it seems overwhelming at first, we're here to help you getting started.

## General
We are working with the Code Owners feature of GitHub.  
This means each piece of code in our binding has a maintainer who is the "Owner" of said code. This maintainer is usually the one who implemented it or has the most knowledge about that particular part of the binding.  
General code may not have a specific "Owner". In this case the fallback is: all Maintainers.  


## Before Contributing
Before you start to invest your precious time in writing code that you want to contribute, consider following these guidelines. They are here to make the lives of all people involved easier.

- If you have an idea or a bug you want to fix, first look if an issue already exists that describes this Feature/Bug.  
- If such a issue exists, and a person is already assigned, it means the assigned person is working on it. But don't go away yet! Maybe this person could need your help, or you have some valuable input for the topic.  
- If the issue exists, but no one is assigned. You are free to state your interest in implementing/fixing the issue. But don't just start working. To prevent multiple people working on the same issue, we need to know you're working on it. Write in the issue, so we can assign it to you.
- If the issue does not yet exist, open one and describe as best as you can, what your idea/what the bug is you want to tackle. The provided templates are a good starting point.


## Discussions
Most of our discussions are happening on Discord. So if you have Discord or don't mind starting using it, feel free to [join](https://discord.gg/qSU2EQs) our server.  
But don't worry if you don't have or want to use Discord. Then the discussions are just in the corresponding issue.  
If you discuss on Discord though: don't forget to document all relevant outcome in the corresponding issue.  

If you have critique or an opinion on a discussed topic, please be kind and give valuable feedback.  
If you are on the receiving end of the critique: don't take it personally. Many people are no native english speaker and it can happen that something which is not rude at all in the language of the writer, might sound rude in english.


================================================
FILE: docs/src/doc/index.md
================================================
[![GitHub](https://img.shields.io/github/license/utopia-rise/godot-kotlin?style=flat-square)](LICENSE)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/utopia-rise/godot-kotlin/CI?style=flat-square)](https://github.com/utopia-rise/godot-kotlin/actions?query=workflow%3ACI)

godot-kotlin is a Kotlin Native binding for the Godot game engine which allows you to write your game's logic in Kotlin.

If you are new to this binding, it is recommended to read through versioning section of this page, and the API differences 
section which describes main differences between Godot's in-house scripting language GDScript and this binding.  
Also, make sure you have read and understood the important notes section. For questions and further information, head over to [discord](https://godot-kotl.in).

## Versioning
The binding uses semantic versioning for its own versions but adds a suffix for the supported godot version:
  
`0.1.0-3.2`  
Binding Version: `0.1.0`  
Supported Godot Version: `3.2`

## Important notes

This version of the binding is currently in **Alpha** state and by no means production ready!  

This state will not change in the near foreseeable future. The Kotlin Native performance is not where it needs to be to make this binding efficient. Currently, the build times are incredibly slow due to the lack of incremental build support in Kotlin Native. Also, the runtime performance is much slower than GDScript in many cases.  
The only case where this binding shines at the moment is in computation heavy scenarios like implementing an A* pathfinding algorithm where not many calls through the cinterop layer of K/N are necessary. In all other cases were many calls are needed, like Input checking and small logic in function like `_process`, the performance is not great because of the current performance of the K/N cinterop layer.  
We were and are in touch with JB regarding those issues on youtrack and slack: [KT-40652](https://youtrack.jetbrains.com/issue/KT-40652) and [KT-40679](https://youtrack.jetbrains.com/issue/KT-40679)

To still be able to use kotlin in a performant way, we started another project [(godot-jvm)](https://github.com/utopia-rise/godot-jvm/) which leverages an embedded JVM to use kotlin on the JVM rather than native. On our first tests, this increases performance dramatically and one can leverage the full JVM ecosystem. Head over there to see development updates.  
This binding will not die though. We will provide bugfixes for existing bugs if necessary, keep it as up to date as our time allows us to do, but we will not improve tooling or add new features until the performance of K/N is more acceptable.

================================================
FILE: docs/src/doc/setup/gradle.md
================================================
This binding uses [Gradle](https://gradle.org) as its build tool and you will need version 6.0 or higher installed. The next requirement is to have a Godot project (obviously!), if you don't have it yet please create one.

Open a terminal and `cd` to root directory of your Godot project.

## Wrapper
On this step, we will be setting up a Gradle [wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html). The wrapper will ensure that anyone who wants to build your project from source will use the same gradle version.

```shell
touch build.gradle.kts gradle.properties settings.gradle.kts
```

The above command will create three files, which will be empty for now.

```shell
gradle wrapper --gradle-version=6.5.1
```

That is it, you have the wrapper installed! The command will produce several files, but the important ones are `gradlew` and `gradlew.bat`. Moving forward we will be using `gradlew` to run gradle (`gradlew.bat` on Windows). The first time `gradlew` is used it will download the gradle version you have specified before.

## Configuring gradle
Once you have the wrapper installed, we need to set up the Gradle plugin provided by this binding. Without the plugin, you will have to manually generate the entry point, `.gdnlib` and `.gdns` files.

**build.gradle.kts**

!!! important ""
    Replace `<kotlin-version>` and `godot-kotlin-version>` with the appropriate kotlin and godot-kotlin versions, respectively.
```kotlin
plugins {
    kotlin("multiplatform") version "<kotlin-version>"
    id("com.utopia-rise.godot-kotlin") version "<godot-kotlin-version>"
}

repositories {
    jcenter()
    mavenCentral()
    // if you want to use bleeding edge builds
    maven("https://dl.bintray.com/utopia-rise/godot-kotlin-dev")
}

godot {
    // Build a debug binary
    debug.set(true)
    // Configure to build for all supported platforms.
    defaultPlatforms()
}
```

**gradle.properties**

!!! important ""
    We need to give the gradle enough memory as the default settings is not enough for the Kotlin Native compiler.
    
```properties
org.gradle.jvmargs=-Xmx3G
```

    
**settings.gradle.kts**

!!! danger ""
    This section is optional and is only required if you are using a bleeding edge build.
    
```kotlin
pluginManagement {
    repositories {
        jcenter()
        gradlePluginPortal()
        maven("https://dl.bintray.com/utopia-rise/godot-kotlin-dev")
    }
    resolutionStrategy.eachPlugin {
        when (requested.id.id) {
            "com.utopia-rise.godot-kotlin" -> useModule("com.utopia-rise:godot-gradle-plugin:${requested.version}")
        }
    }
}
```
    
## Importing project into IntelliJ IDEA
Before proceeding to the next section, follow [this guide](ide.md) on how to import your project into IntelliJ IDEA.

## Creating your first class

Let's create a file `src/godotMain/kotlin/Simple.kt` with the following contents.

```kotlin
import godot.*
import godot.annotation.*
import godot.core.*

@RegisterClass
class Simple: Spatial() {

    @RegisterFunction
    override fun _ready() {
        GD.print("Hello Godot from Kotlin!")
    }
}
```

`@RegisterClass` will register the annotated class to Godot. More details can be found in the [classes](../user-guide/classes.md) section of the user guide
    
Now we can trigger a build.

```shell
./gradlew build
``` 

!!! note ""
    The plugin automatically generates the appropriate `gdns` files which can be found at `src/gdns`. It is up to you whether you want to include those files in source control or not.

Once the build completes, a file `src/gdns/Simple.gdns` is generated. You can use `Simple.gdns` in Godot when assigning a script to a node.

![Attach Node Script](../assets/img/attach.png)

## Configuring target platforms

Using `defaultPlatforms()` will configure the build to build for all supported platforms. If you want to specify specific platforms, you can do this via the `platforms` property of `godot`.

```kotlin
import godot.gradle.GodotPlatform

godot {
  platforms(GodotPlatform.WINDOWS_X64)
}
```

## All Godot plugin configurations

| Property              | Type                | Description                                                                                                                                                                                                                                                                                                          |
|-----------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| debug                 | Boolean             | Sets if a debug or a release build should be built. **Note:** as of kotlin version `1.3.72` release builds are broken on the kotlin side!                                                                                                                                                                            |
| gdnsDir               | File                | Changes the default (`src/gdns/`) output dir for generated gdns files                                                                                                                                                                                                                                                |
| gdnlibFile            | File                | You can set the name `gdnlib` file yourself if you want to create it yourself or don't want the generated one to be named `lowercasedProjectName.gdnlib`                                                                                                                                                             |
| singleton             | Boolean             | Sets the `singleton` property inside the generated `gdnlib` file                                                                                                                                                                                                                                                     |
| loadOnce              | Boolean             | Sets the `load_once` property inside the generated `gdnlib` file                                                                                                                                                                                                                                                     |
| reloadable            | Boolean             | Sets the `reloadable` property inside the generated `gdnlib` file                                                                                                                                                                                                                                                    |
| platforms             | List<GodotPlatform> | Sets the targets platforms                                                                                                                                                                                                                                                                                           |

================================================
FILE: docs/src/doc/setup/ide.md
================================================
You will need either [IntelliJ IDEA](https://jetbrains.com/idea) (Ultimate is preferred but the Community edition works too!) or [CLion](https://www.jetbrains.com/clion/) (**Note:** as of kotlin version `1.4` the CLion Kotlin/Native plugin is deprecated! Use Intellj IDEA if you are using kotlin version `1.4` or above!). The easiest way to install them is via the [JetBrains Toolbox](https://www.jetbrains.com/toolbox-app/) app.


## Kotlin plugin
Regardless of what IDE you choose, you need to install the appropriate Kotlin plugin. This can be done within the IDE (`Settings -> Plugins`). You have to install `Kotlin` plugin for IntelliJ IDEA while install `Kotlin/Native for CLion` plugin for CLion.

## Importing
Once you have the plugin installed, you can start importing your project.

![Import](../assets/img/import.png)

Click `Import Project` and select your project's `build.gradle.kts` file. The IDE will take some time to index your project, but once done you can start coding!

================================================
FILE: docs/src/doc/supported-platforms.md
================================================
While Kotlin Native and Godot supports a wide range of platforms, this binding for the moment only supports the following:

- Windows X64
- Linux X64
- MacOS X64

Mobile platforms such as Android and iOS will be supported at a later date.

================================================
FILE: docs/src/doc/user-guide/classes.md
================================================
To expose a class written in Kotlin it needs to extend `godot.Object` (or any type that extends it) and annotate it with `@RegisterClass`.

```kotlin
@RegisterClass
class RotatingCube: Spatial() {
    ...
}
```

## Lifecycle
If you want to be notified when initialization and destruction of your class happens, override `_onInit` and `_onDestroy` functions, respectively.

```kotlin
@RegisterClass
class RotatingCube: Spatial() {
    override fun _onInit() {
        GD.print("Initializing RotatingCube!")
    }
    
    override fun _onDestroy() {
        GD.print("Cleaning up RotatingCube!")
    }
}
```

`_onInit` is equivalent to GDScript's constructor `_init`, however, `_onInit` and `_onDestroy` are handled directly by this binding, not Godot.

## Instance checks
Checking if an object is an instance of a particular type can be done via the `is` operator.

```kotlin
@RegisterFunction
override fun _ready() {
    val parent = getParent()
    if (parent is CollisionShape) {
        // smart cast works!
        parent.setShape(...)
    } else {
        throw AssertionError("Unexpected parent!")
    }
}
```

This also works for any type you define. 

If you are sure that an object is always an instance of some type, then you can take advantage of Kotlin's [contracts](https://kotlinlang.org/docs/reference/whatsnew13.html#contracts) feature.

```kotlin
@RegisterFunction
override fun _ready() {
    val parent = getParent()
    require(parent is CollisionShape)
    // smart cast works here as well!
    parent.setShape(...)
}
```


## Registration Configuration
You can customize to some extent how your class should be registered in Godot:

The `@RegisterClass` annotation can take one argument:

- **isTool**: If set to true, this class is treated as a tool class. Similar to the `tool` of GDScript. **Default:** false



## What's next?
 - [Registering properties](properties.md)
 - [Registering functions](methods.md)
 - [Registering signals](signals.md)


================================================
FILE: docs/src/doc/user-guide/methods.md
================================================
Any Kotlin function can be registered as long as its parameters and return type can be converted to a 
`Variant`, additionally the function must be annotated with `@RegisterFunction`. This binding only support 
methods with at most 10 parameters at the moment.

```kotlin
@RegisterClass
class RotatingCube: Spatial() {
    
    @RegisterFunction  
    override fun _ready() {
        GD.print("I am ready!")
    }
}
```

!!! important ""
    All methods that you register, are registered in `snake_case`! So `myVeryCoolFunction` will become `my_very_cool_function`. This is done for easier GDScript integration and that Godot can properly call overridden virtual functions from other languages. Keep this in mind when calling kotlin functions from other languages or when using functions like `call` and not using our extension functions which handle the conversion for you!

## Virtual methods
Virtual methods (like `_ready`, `_process` and `_physics_process`) are declared as overridable methods. The default implementation throws a `NotImplementedException`, so you have to override it if you plan to expose a virtual method to Godot.  
Remember; just overriding is not enough to use that function. You have to explicitly register it as well with `@RegisterFunction` like you have to with your own methods.

## Registration Configuration
You can customize to some extent how your function should be registered in Godot:

The `@RegisterFunction` annotation takes one argument:

- **rpcMode**: Default: `RPCMode.DISABLED`

================================================
FILE: docs/src/doc/user-guide/properties.md
================================================
Any property of a registered class can be registered as long as it meets all of the following requirements:  
 
 - Defined inside a registered class  
 - Mutable  
 - Annotated with `@RegisterProperty`  
 - Type can be converted to `Variant`  
 


```kotlin
@RegisterClass
class RotatingCube: Spatial() {
    
    @RegisterProperty  
    lateinit var lateInitProperty: NodePath

    @RegisterProperty
    var propertyWithDefaultValue: Float = 2f
}
```

!!! important ""
    All properties that you register, are registered in `snake_case`! So `myVeryCoolProperty` will become `my_very_cool_property`. This is done for easier GDScript integration. Keep this in mind when interacting with kotlin properties from other languages.

## Default Values
If you define a default value for a property and `visibleInEditor` (more on that later) is set to `true`, the default value will be set in the `inspector`.   
**Note:** If you set a default value in code and a different value in the `inspector` the value of the `inspector` will override the value in code after `init` and before `_ready`!  
A default value can **only** contain compile time constants and only References to compile time constants! Better you only use refs where you have no other choice like for Enums.  
We try to catch all wrong references during compilation and throw a corresponding exception but we may have missed some cases which then only occur during runtime.


## Registration Configuration
You can customize to some extent how your property should be registered in Godot:

The `@RegisterProperty` annotation takes two arguments:

- **visibleInEditor**: If set to `true` the property is visible in the `inspector`. Default: `true`
- **rpcMode**: Default: `RPCMode.DISABLED`

## Type Hint Registration
This binding provides a plethora of annotations for defining Property Type Hints. These annotations are for the `inspector` to provide proper hints and editors to set and change values from within the inspector (like a color wheel, checkboxes, file dialogs, and so on...).  
Each property hint annotation can only be added to certain types of properties. Currently, the checks if the type is correct happens during compilation as we do not have an IDEA plugin yet. If the type is not correct, the compilation will fail.  
Below is a list of currently implemented type hints:  

| Annotation      | Type of Property           | Arguments                                                             | Short Description                                                                                                                                |
|-----------------|----------------------------|-----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| IntRange        | Int                        | start: Int, end: Int, step: Int = -1, or: Range = Range.NONE          | Provides a range of ints from start to end, with optional steps, and optional `lesser or greater`                                                |
| FloatRange      | Float                      | start: Float, end: Float, step: Float = -1, or: Range = Range.NONE    | Provides a range of floats from start to end, with optional steps, and optional `lesser or greater`                                              |
| DoubleRange     | Double                     | start: Double, end: Double, step: Double = -1, or: Range = Range.NONE | Provides a range of doubles from start to end, with optional steps, and optional `lesser or greater`                                             |
| ExpRange        | Float Double               | start: Float, end: Float, step: Float = -1, or: Range = Range.NONE    | Provides a exponential range of doubles or floats from start to end, with optional steps, and optional `lesser or greater`                       |
| EnumTypeHint    | Enum                       |                                                                       | Registers an enum. The editor then provides a selection of the possible enum values                                                              |
| ExpEasing       | Float Double               | attenuation: Boolean = false, inOut: Boolean = true                   | N/A                                                                                                                                              |
| EnumFlag        | Set<Enum> MutableSet<Enum> |                                                                       | Registers a flag with the enum names set as the flag names. The values in the set define which flags are set.                                    |
| IntFlag         | Int                        | names: vararg String                                                  | Same as enum flag but the `names` set which values can be set in the inspector and no automatic conversion to the individual flag values happen. |
| File            | String                     | extensions: Array<String> = [], global: Boolean = false               | The inspector will show a File dialog in which you can select a File. The Path of the file will be stored in the property.                       |
| Dir             | String                     | global: Boolean = false                                               | The inspector will show a File dialog in which you can select a directory. The Path of the directory will be stored in the property.             |
| MultilineText   | String                     |                                                                       | The inspector shows a multiline text input.                                                                                                      |
| PlaceHolderText | String                     |                                                                       | N/A                                                                                                                                              |
| ColorNoAlpha    | Color                      |                                                                       | The inspector shows a color selection dialog without Alpha                                                                                       |


================================================
FILE: docs/src/doc/user-guide/signals.md
================================================
Use the delegate `signal` to create a signal and annotate it with `@RegisterSignal`. Note that the name of 
the signal must start with a prefix `signal` (see [API differences](../api-differences.md) section for an explanation).
This binding only supports signals with at most 10 parameters at the moment.

```kotlin
@RegisterClass
class RotatingCube: Spatial() {
    @RegisterSignal  
    val signalReverseChanged by signal<Boolean>("reverse")
}
```

!!! important ""
    All signals that you register, are registered in `snake_case`! Also the `signal` prefix will be dropped (like described in [API differences](../api-differences.md)). So `signalVeryCoolSignal` will become `very_cool_signal`. This is done for easier GDScript integration. Also in GDScript signals can have the same name as properties, which is not possible in kotlin as signals **are** properties. Keep this in mind when interacting with in kotlin defined signals from other languages or when using functions like `emit` from an `Object` rather from the signal property. 

## Emitting
Every signal has a `emit` method which can be used to emit it.

```kotlin
signalReverseChanged.emit(false)
```

## Subscribing
A method can be subscribed/connected to a signal via `connect`. The number of parameters of the method and signal must match.

```kotlin
class SomeObject: Object() {
    fun onReverseChanged(reverse: Boolean) {
        GD.print("Value of reverse has changed: $reverse")
    } 
}

val targetObject = SomeObject()
signalReverseChanged.connect(targetObject, targetObject::onReverseChanged)
```

================================================
FILE: entry-generation/godot-annotation-processor/build.gradle.kts
================================================
plugins {
    kotlin("jvm")
    `maven-publish`
}

dependencies {
    implementation(project(":godot-entry-generator"))
    implementation("de.jensklingenberg:mpapt-runtime:${DependenciesVersions.mpaptVersion}")
    compileOnly(kotlin("compiler"))
}

tasks {
    val sourceJar by creating(Jar::class) {
        archiveBaseName.set(project.name)
        archiveVersion.set(project.version.toString())
        archiveClassifier.set("sources")
        from(sourceSets["main"].allSource)
    }

    build {
        finalizedBy(publishToMavenLocal)
    }
}

publishing {
    publications {
        val godotAnnotationProcessor by creating(MavenPublication::class) {
            pom {
                groupId = "${project.group}"
                artifactId = project.name
                version = "${project.version}"
            }
            from(components.getByName("java"))
            artifact(tasks.getByName("sourceJar"))
        }
    }
}

project.extra["artifacts"] = arrayOf("godotAnnotationProcessor")

apply {
    plugin(BintrayPublish::class.java)
}


================================================
FILE: entry-generation/godot-annotation-processor/src/main/kotlin/godot/annotation/processor/GodotAnnotationProcessor.kt
================================================
package godot.annotation.processor

import de.jensklingenberg.mpapt.model.AbstractProcessor
import de.jensklingenberg.mpapt.model.Element
import de.jensklingenberg.mpapt.model.RoundEnvironment
import de.jensklingenberg.mpapt.utils.KotlinPlatformValues
import godot.entrygenerator.EntryGenerator
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.platform.TargetPlatform
import org.jetbrains.kotlin.resolve.BindingContext
import java.lang.instrument.IllegalClassFormatException

class GodotAnnotationProcessor(
    private val entryGenerationOutputDir: String,
    private val gdnsGenerationOutputDir: String,
    private val gdnlibGenerationOutputFile: String,
    private val cleanGeneratedGdnsFiles: Boolean
) : AbstractProcessor() {
    lateinit var bindingContext: BindingContext
    override fun getSupportedAnnotationTypes(): Set<String> =
        setOf(
            "godot.annotation.RegisterClass",
            "godot.annotation.RegisterProperty",
            "godot.annotation.RegisterFunction",
            "godot.annotation.RegisterSignal"
        )

    override fun isTargetPlatformSupported(platform: TargetPlatform): Boolean {
        return when (val targetName = platform.first().platformName) {
            KotlinPlatformValues.JS -> false
            KotlinPlatformValues.JVM -> false
            KotlinPlatformValues.NATIVE -> true
            else -> {
                log("Unknown configured target: $targetName")
                false
            }
        }
    }

    private val classes: MutableSet<ClassDescriptor> = mutableSetOf()
    private val properties: MutableSet<PropertyDescriptor> = mutableSetOf()
    private val functions: MutableSet<FunctionDescriptor> = mutableSetOf()
    private val signals: MutableSet<PropertyDescriptor> = mutableSetOf()

    override fun process(roundEnvironment: RoundEnvironment) {
        classes.addAll(
            roundEnvironment
                .getElementsAnnotatedWith("godot.annotation.RegisterClass")
                .map { it as Element.ClassElement }
                .map { it.classDescriptor }
        )

        properties.addAll(
            roundEnvironment
                .getElementsAnnotatedWith("godot.annotation.RegisterProperty")
                .map { it as Element.PropertyElement }
                .map { it.propertyDescriptor }
        )

        functions.addAll(
            roundEnvironment
                .getElementsAnnotatedWith("godot.annotation.RegisterFunction")
                .map { it as Element.FunctionElement }
                .map { it.func }
        )

        signals.addAll(
            roundEnvironment
                .getElementsAnnotatedWith("godot.annotation.RegisterSignal")
                .map { it as Element.PropertyElement }
                .map { it.propertyDescriptor }
        )

        performSanityChecks()
    }

    private fun performSanityChecks() {
        classes.forEach {
            if (it.constructors.size > 1) {
                throw IllegalClassFormatException("A Class annotated with \"@RegisterClass\" can only have a default constructor!\nBut ${it.name} contains ${it.constructors.size} constructors")
            }
        }
        functions.forEach {
            if (!classes.contains(it.containingDeclaration)) {
                throw Exception("${it.containingDeclaration.name.asString()} contains a registered function: ${it.name} but is not annotated with @RegisterClass! Classes containing functions which are registered, also have to be registered!")
            }
        }
        properties.forEach {
            if (!classes.contains(it.containingDeclaration)) {
                throw Exception("${it.containingDeclaration.name.asString()} contains a registered property: ${it.name} but is not annotated with @RegisterClass! Classes containing properties which are registered, also have to be registered!")
            }
        }
        signals.forEach {
            if (!classes.contains(it.containingDeclaration)) {
                throw Exception("${it.containingDeclaration.name.asString()} contains a signal: ${it.name} but is not annotated with @RegisterClass! Classes containing signals, also have to be registered!")
            }
        }
    }

    override fun processingOver() {
        val entryGenerator = EntryGenerator(bindingContext)
        entryGenerator.generateEntryFile(entryGenerationOutputDir, classes, properties, functions, signals)
        entryGenerator.generateGdnsFiles(
            gdnsGenerationOutputDir,
            gdnlibGenerationOutputFile,
            cleanGeneratedGdnsFiles,
            classes
        )
    }
}


================================================
FILE: entry-generation/godot-compiler-native-plugin/build.gradle.kts
================================================
import com.github.jengelman.gradle.plugins.shadow.ShadowExtension
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath("com.github.jengelman.gradle.plugins:shadow:${DependenciesVersions.shadowJarPluginVersion}")
    }
}

plugins {
    kotlin("jvm")
    `maven-publish`
}

apply(plugin = "com.github.johnrengelman.shadow")

val embeddable by configurations.creating {
    extendsFrom(configurations.implementation.get())
}

dependencies {
    implementation(project(":godot-annotation-processor"))
    implementation(project(":godot-compiler-plugin-common"))
    implementation("de.jensklingenberg:mpapt-runtime:${DependenciesVersions.mpaptVersion}")
    compileOnly(kotlin("compiler"))
}

val shadowJar by tasks.getting(ShadowJar::class) {
    configurations = listOf(embeddable)
    @Suppress("UnstableApiUsage")
    manifest {
        attributes["Implementation-Title"] = "Godot Kotlin Native Compiler Plugin"
        attributes["Implementation-Version"] = project.version
        attributes["Main-Class"] = "godot.compilerplugin.NativeComponentRegistrar"
    }
    archiveBaseName.set("godot-compiler-native-plugin")
    archiveVersion.set(project.version.toString())
    val classifier: String? = null //needed as we need to specify the type null represents. otherwise we get ambiguous overload exception during build
    archiveClassifier.set(classifier)
}

tasks {
    val sourceJar by creating(Jar::class) {
        archiveBaseName.set(project.name)
        archiveVersion.set(project.version.toString())
        archiveClassifier.set("sources")
        from(sourceSets["main"].allSource)
    }

    build {
        finalizedBy(publishToMavenLocal)
    }
}

publishing {
    publications {
        val shadow by creating(MavenPublication::class) {
            pom {
                groupId = "${project.group}"
                artifactId = project.name
                version = "${project.version}"
            }
            project.extensions.getByType(ShadowExtension::class).component(this)
            artifact(tasks.getByName("sourceJar"))
        }
    }
}

project.extra["artifacts"] = arrayOf("shadow")

apply {
    plugin(BintrayPublish::class.java)
}


================================================
FILE: entry-generation/godot-compiler-native-plugin/src/main/kotlin/godot/compiler/plugin/NativeComponentRegistrar.kt
================================================
package godot.compiler.plugin

import com.intellij.mock.MockProject
import de.jensklingenberg.mpapt.common.MpAptProject
import godot.annotation.processor.GodotAnnotationProcessor
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.compiler.plugin.*
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.extensions.StorageComponentContainerContributor
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment

class NativeComponentRegistrar : ComponentRegistrar {
    override fun registerProjectComponents(project: MockProject, configuration: CompilerConfiguration) {
        val enabled = checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.ENABLED)) {
            "enabled parameter missing"
        }

        if (enabled) {
            val processor = GodotAnnotationProcessor(
                checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.ENTRY_DIR_PATH)) { "No path for generated entry file specified" },
                checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.GDNS_DIR_PATH)) { "No path for generated gdns files specified" },
                checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.GDNLIB_FILE_PATH)) { "No path for generated gdnlib file specified" },
                checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.CLEAN_GENERATED_GDNS_FILES)) { "No clean generated gdns files option specified" }
            )
            val mpapt = MpAptProject(processor, configuration)

            StorageComponentContainerContributor.registerExtension(project, mpapt)
            IrGenerationExtension.registerExtension(project, object : IrGenerationExtension {
                override fun generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) {
                    processor.bindingContext = pluginContext.bindingContext
                    mpapt.generate(moduleFragment, pluginContext)
                }
            })
        }
    }
}

class NativeGodotKotlinCompilerPluginCommandLineProcessor : CommandLineProcessor {
    companion object {
        val GDNS_DIR_PATH_OPTION = CliOption(
            CompilerPluginConst.CommandLineOptionNames.gdnsDirPathOption,
            "Absolute Path as String",
            CompilerPluginConst.CommandlineArguments.GDNS_DIR_PATH.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        val GDNLIB_FILE_PATH_OPTION = CliOption(
            CompilerPluginConst.CommandLineOptionNames.gdnlibFileOption,
            "Absolute Path as String",
            CompilerPluginConst.CommandlineArguments.GDNLIB_FILE_PATH.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        val ENTRY_DIR_PATH_OPTION = CliOption(
            CompilerPluginConst.CommandLineOptionNames.entryDirPathOption,
            "Absolute Path as String",
            CompilerPluginConst.CommandlineArguments.ENTRY_DIR_PATH.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        val ENABLED = CliOption(
            CompilerPluginConst.CommandLineOptionNames.enabledOption,
            "Flag to enable entry generation",
            CompilerPluginConst.CommandlineArguments.ENABLED.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        val CLEAN_GENERATED_GDNS_FILES = CliOption(
            CompilerPluginConst.CommandLineOptionNames.cleanGeneratedGdnsFiles,
            "Flag to enable entry generation",
            CompilerPluginConst.CommandlineArguments.CLEAN_GENERATED_GDNS_FILES.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        const val PLUGIN_ID = CompilerPluginConst.compilerPluginId
    }

    override val pluginId = PLUGIN_ID
    override val pluginOptions = listOf(
        GDNS_DIR_PATH_OPTION,
        GDNLIB_FILE_PATH_OPTION,
        ENTRY_DIR_PATH_OPTION,
        ENABLED,
        CLEAN_GENERATED_GDNS_FILES
    )

    override fun processOption(option: AbstractCliOption, value: String, configuration: CompilerConfiguration) {
        return when (option) {
            GDNS_DIR_PATH_OPTION -> configuration.put(
                CompilerPluginConst.CommandlineArguments.GDNS_DIR_PATH, value
            )
            GDNLIB_FILE_PATH_OPTION -> configuration.put(
                CompilerPluginConst.CommandlineArguments.GDNLIB_FILE_PATH, value
            )
            ENTRY_DIR_PATH_OPTION -> configuration.put(
                CompilerPluginConst.CommandlineArguments.ENTRY_DIR_PATH, value
            )
            ENABLED -> configuration.put(
                CompilerPluginConst.CommandlineArguments.ENABLED, value.toBoolean()
            )
            CLEAN_GENERATED_GDNS_FILES -> configuration.put(
                CompilerPluginConst.CommandlineArguments.CLEAN_GENERATED_GDNS_FILES, value.toBoolean()
            )
            else -> throw CliOptionProcessingException("Unknown option: ${option.optionName}")
        }
    }
}


================================================
FILE: entry-generation/godot-compiler-native-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
================================================
godot.compiler.plugin.NativeGodotKotlinCompilerPluginCommandLineProcessor

================================================
FILE: entry-generation/godot-compiler-native-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
================================================
godot.compiler.plugin.NativeComponentRegistrar

================================================
FILE: entry-generation/godot-compiler-plugin/build.gradle.kts
================================================
plugins {
    kotlin("jvm")
    `maven-publish`
}

dependencies {
    implementation(project(":godot-annotation-processor"))
    implementation(project(":godot-compiler-plugin-common"))
    implementation("de.jensklingenberg:mpapt-runtime:${DependenciesVersions.mpaptVersion}")
    compileOnly(kotlin("compiler"))
}

tasks {
    val sourceJar by creating(Jar::class) {
        archiveBaseName.set(project.name)
        archiveVersion.set(project.version.toString())
        archiveClassifier.set("sources")
        from(sourceSets["main"].allSource)
    }

    build {
        finalizedBy(publishToMavenLocal)
    }
}

publishing {
    publications {
        val godotCompilerPlugin by creating(MavenPublication::class) {

            pom {
                groupId = "${project.group}"
                artifactId = project.name
                version = "${project.version}"
            }
            from(components.getByName("java"))
            artifact(tasks.getByName("sourceJar"))
        }
    }
}

project.extra["artifacts"] = arrayOf("godotCompilerPlugin")

apply {
    plugin(BintrayPublish::class.java)
}


================================================
FILE: entry-generation/godot-compiler-plugin/src/main/kotlin/godot/compiler/plugin/CommonComponentRegistrar.kt
================================================
package godot.compiler.plugin

import com.intellij.mock.MockProject
import de.jensklingenberg.mpapt.common.MpAptProject
import godot.annotation.processor.GodotAnnotationProcessor
import org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension
import org.jetbrains.kotlin.compiler.plugin.*
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.extensions.StorageComponentContainerContributor
import org.jetbrains.kotlin.js.translate.extensions.JsSyntheticTranslateExtension

class CommonComponentRegistrar : ComponentRegistrar {
    override fun registerProjectComponents(
        project: MockProject,
        configuration: CompilerConfiguration
    ) {
        val enabled = checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.ENABLED)) {
            "enabled parameter missing"
        }
        if (enabled) {
            val processor = GodotAnnotationProcessor(
                checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.ENTRY_DIR_PATH)) { "No path for generated entry file specified" },
                checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.GDNS_DIR_PATH)) { "No path for generated gdns files specified" },
                checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.GDNLIB_FILE_PATH)) { "No path for generated gdnlib file specified" },
                checkNotNull(configuration.get(CompilerPluginConst.CommandlineArguments.CLEAN_GENERATED_GDNS_FILES)) { "No clean generated gdns files option specified" }
            )
            val mpapt = MpAptProject(processor, configuration)
            StorageComponentContainerContributor.registerExtension(project, mpapt)
            ClassBuilderInterceptorExtension.registerExtension(project, mpapt)
            JsSyntheticTranslateExtension.registerExtension(project, mpapt)
        }
    }
}

class CommonGodotKotlinCompilerPluginCommandLineProcessor : CommandLineProcessor {
    companion object {
        val GDNS_DIR_PATH_OPTION = CliOption(
            CompilerPluginConst.CommandLineOptionNames.gdnsDirPathOption,
            "Path to where the generated gdns files should be written to",
            CompilerPluginConst.CommandlineArguments.GDNS_DIR_PATH.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        val GDNLIB_FILE_PATH_OPTION = CliOption(
            CompilerPluginConst.CommandLineOptionNames.gdnlibFileOption,
            "Absolute Path as String",
            CompilerPluginConst.CommandlineArguments.GDNLIB_FILE_PATH.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        val ENTRY_DIR_PATH_OPTION = CliOption(
            CompilerPluginConst.CommandLineOptionNames.entryDirPathOption,
            "Path to where the generated entry file should be written to",
            CompilerPluginConst.CommandlineArguments.ENTRY_DIR_PATH.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        val ENABLED = CliOption(
            CompilerPluginConst.CommandLineOptionNames.enabledOption,
            "Flag to enable entry generation",
            CompilerPluginConst.CommandlineArguments.ENABLED.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        val CLEAN_GENERATED_GDNS_FILES = CliOption(
            CompilerPluginConst.CommandLineOptionNames.cleanGeneratedGdnsFiles,
            "Flag to enable entry generation",
            CompilerPluginConst.CommandlineArguments.CLEAN_GENERATED_GDNS_FILES.toString(),
            required = true,
            allowMultipleOccurrences = false
        )

        const val PLUGIN_ID = CompilerPluginConst.compilerPluginId
    }

    override val pluginId = PLUGIN_ID
    override val pluginOptions = listOf(
        GDNS_DIR_PATH_OPTION,
        GDNLIB_FILE_PATH_OPTION,
        ENTRY_DIR_PATH_OPTION,
        ENABLED,
        CLEAN_GENERATED_GDNS_FILES
    )

    override fun processOption(option: AbstractCliOption, value: String, configuration: CompilerConfiguration) {
        return when (option) {
            GDNS_DIR_PATH_OPTION -> configuration.put(
                CompilerPluginConst.CommandlineArguments.GDNS_DIR_PATH, value
            )
            GDNLIB_FILE_PATH_OPTION -> configuration.put(
                CompilerPluginConst.CommandlineArguments.GDNLIB_FILE_PATH, value
            )
            ENTRY_DIR_PATH_OPTION -> configuration.put(
                CompilerPluginConst.CommandlineArguments.ENTRY_DIR_PATH, value
            )
            ENABLED -> configuration.put(
                CompilerPluginConst.CommandlineArguments.ENABLED, value.toBoolean()
            )
            CLEAN_GENERATED_GDNS_FILES -> configuration.put(
                CompilerPluginConst.CommandlineArguments.CLEAN_GENERATED_GDNS_FILES, value.toBoolean()
            )
            else -> throw CliOptionProcessingException("Unknown option: ${option.optionName}")
        }
    }
}


================================================
FILE: entry-generation/godot-compiler-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
================================================
godot.compiler.plugin.CommonGodotKotlinCompilerPluginCommandLineProcessor

================================================
FILE: entry-generation/godot-compiler-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
================================================
godot.compiler.plugin.CommonComponentRegistrar

================================================
FILE: entry-generation/godot-compiler-plugin-common/build.gradle.kts
================================================
plugins {
    kotlin("jvm")
    `maven-publish`
}

dependencies {
    compileOnly(kotlin("compiler"))
}

tasks {
    val sourceJar by creating(Jar::class) {
        archiveBaseName.set(project.name)
        archiveVersion.set(project.version.toString())
        archiveClassifier.set("sources")
        from(sourceSets["main"].allSource)
    }

    build {
        finalizedBy(publishToMavenLocal)
    }
}


publishing {
    publications {
        val godotCompilerPluginCommon by creating(MavenPublication::class) {
            pom {
                groupId = "${project.group}"
                artifactId = project.name
                version = "${project.version}"
            }
            from(components.getByName("java"))
            artifact(tasks.getByName("sourceJar"))
        }
    }
}

project.extra["artifacts"] = arrayOf("godotCompilerPluginCommon")

apply {
    plugin(BintrayPublish::class.java)
}


================================================
FILE: entry-generation/godot-compiler-plugin-common/src/main/kotlin/godot/compiler/plugin/CompilerPluginConst.kt
================================================
package godot.compiler.plugin

import org.jetbrains.kotlin.config.CompilerConfigurationKey

object CompilerPluginConst {
    const val compilerPluginGroupId = "com.utopia-rise"

    const val compilerPluginArtifactId = "godot-compiler-plugin"
    const val compilerNativePluginArtifactId = "godot-compiler-native-plugin"
    const val compilerPluginId = "GodotCompilerPlugin"

    //Remember to change according to gradle.properties
    const val godotVersion = "3.2"

    object CommandLineOptionNames {
        const val gdnsDirPathOption = "gdns-dir-path"
        const val gdnlibFileOption = "gdnlib-file-path"
        const val entryDirPathOption = "entry-dir-path"
        const val enabledOption = "enabled"
        const val cleanGeneratedGdnsFiles = "clean-generated-gdns-files"
    }

    object CommandlineArguments {
        val GDNS_DIR_PATH: CompilerConfigurationKey<String> =
            CompilerConfigurationKey.create("path to root of godot project")
        val GDNLIB_FILE_PATH: CompilerConfigurationKey<String> =
            CompilerConfigurationKey.create("path to where the gdnlib file should be generated")
        val ENTRY_DIR_PATH: CompilerConfigurationKey<String> =
            CompilerConfigurationKey.create("path to the folder in which the generated entry file should be written")
        val ENABLED: CompilerConfigurationKey<Boolean> =
            CompilerConfigurationKey.create("flag to enable entry generation")
        val CLEAN_GENERATED_GDNS_FILES: CompilerConfigurationKey<Boolean> =
            CompilerConfigurationKey.create("flag to clean generated gdns files that don't have an associated class anymore")
    }
}


================================================
FILE: entry-generation/godot-entry-generator/build.gradle.kts
================================================
plugins {
    kotlin("jvm")
    `maven-publish`
}

dependencies {
    implementation(kotlin("stdlib"))
    compileOnly(kotlin("compiler"))
    implementation("com.squareup:kotlinpoet:${DependenciesVersions.kotlinPoetVersion}")
}

tasks {
    val sourceJar by creating(Jar::class) {
        archiveBaseName.set(project.name)
        archiveVersion.set(project.version.toString())
        archiveClassifier.set("sources")
        from(sourceSets["main"].allSource)
    }

    build {
        finalizedBy(publishToMavenLocal)
    }
}

publishing {
    publications {
        val godotEntryGenerator by creating(MavenPublication::class) {
            pom {
                groupId = "${project.group}"
                artifactId = project.name
                version = "${project.version}"
            }
            from(components.getByName("java"))
            artifact(tasks.getByName("sourceJar"))
        }
    }
}

project.extra["artifacts"] = arrayOf("godotEntryGenerator")

apply {
    plugin(BintrayPublish::class.java)
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/EntryGenerator.kt
================================================
package godot.entrygenerator

import godot.entrygenerator.filebuilder.EntryFileBuilder
import godot.entrygenerator.generator.GdnsGenerator
import godot.entrygenerator.transformer.transformTypeDeclarationsToClassWithMember
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.resolve.BindingContext

class EntryGenerator(bindingContext: BindingContext) {

    private val entryFileBuilder = EntryFileBuilder(bindingContext)

    fun generateEntryFile(
        outputPath: String,
        classes: Set<ClassDescriptor>,
        properties: Set<PropertyDescriptor>,
        functions: Set<FunctionDescriptor>,
        signals: Set<PropertyDescriptor>
    ) {

        entryFileBuilder
            .registerClassesWithMembers(
                transformTypeDeclarationsToClassWithMember(
                    classes,
                    properties,
                    functions,
                    signals
                )
            )
            .build(outputPath)
    }

    fun generateGdnsFiles(
        outputPath: String,
        gdnLibFile: String,
        cleanGeneratedGdnsFiles: Boolean,
        classes: Set<ClassDescriptor>
    ) {
        GdnsGenerator.generateGdnsFiles(outputPath, gdnLibFile, cleanGeneratedGdnsFiles, classes)
    }
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/exceptions/WrongAnnotationUsageException.kt
================================================
package godot.entrygenerator.exceptions

import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe

class WrongAnnotationUsageException(
    propertyDescriptor: PropertyDescriptor,
    propertyHintAnnotation: AnnotationDescriptor?,
    effectiveType: String? = null
) : Exception(
    "You annotated ${propertyDescriptor.fqNameSafe} with @${propertyHintAnnotation?.fqName?.asString()?.split(".")
        ?.last()} which ${if (effectiveType != null) "is only applicable to properties of type $effectiveType" else "cannot be applied on properties of type ${propertyDescriptor.type}"}"
)


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/AnnotationExt.kt
================================================
package godot.entrygenerator.extension

import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name

fun <T> Annotations.getAnnotationValue(
    annotation: String,
    key: String,
    defaultValue: T
): T {
    return this
        .findAnnotation(FqName(annotation))
        ?.let { annotationDescriptor ->
            @Suppress("UNCHECKED_CAST")
            annotationDescriptor
                .allValueArguments
                .entries
                .firstOrNull { it.key == Name.identifier(key) }
                ?.value
                ?.value as T
                ?: defaultValue
        }
        ?: defaultValue
}

fun <T> AnnotationDescriptor.getAnnotationValue(
    key: String,
    defaultValue: T
): T {
    @Suppress("UNCHECKED_CAST")
    return this
        .allValueArguments
        .entries
        .firstOrNull { it.key == Name.identifier(key) }
        ?.value
        ?.value as T
        ?: defaultValue
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/ClassDescriptorExt.kt
================================================
package godot.entrygenerator.extension

import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.types.asSimpleType

fun ClassDescriptor.getSuperTypeNameAsString(): String {
    return this
        .typeConstructor
        .supertypes
        .first()
        .asSimpleType()
        .toString()
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/KotlinTypeExt.kt
================================================
package godot.entrygenerator.extension

import org.jetbrains.kotlin.js.descriptorUtils.getJetTypeFqName
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.supertypes


fun KotlinType.isCoreType(): Boolean {
    return coreTypes.contains(getJetTypeFqName(false))
}

fun KotlinType.isResource(): Boolean {
    return this.getJetTypeFqName(false) == "godot.Resource"
        || this
        .supertypes()
        .map { it.getJetTypeFqName(false) }
        .any { it == "godot.Resource" }
}

fun KotlinType.isCompatibleList(): Boolean {
    return when {
        getJetTypeFqName(false) == "godot.core.GodotArray" -> true
        else -> supertypes().any { it.getJetTypeFqName(false) == "godot.core.GodotArray" }
    }
}

fun KotlinType.getCompatibleListType(): String {
    return getJetTypeFqName(false).getCompatibleListType()
}

private fun KotlinType.getRegistrableTypeAsFqNameString(): String? {
    return when {
        getJetTypeFqName(false).isGodotPrimitive()
            || isCoreType() -> getJetTypeFqName(false)
        else -> null
    }
}

fun KotlinType.getFirstRegistrableTypeAsFqNameStringOrNull(): String? {
    return getRegistrableTypeAsFqNameString()
        ?: supertypes()
            .firstOrNull { it.getRegistrableTypeAsFqNameString() != null }
            ?.getRegistrableTypeAsFqNameString()
}

private val coreTypes = listOf(
    "godot.core.Vector2",
    "godot.core.Rect2",
    "godot.core.Vector3",
    "godot.core.Transform2D",
    "godot.core.Plane",
    "godot.core.Quat",
    "godot.core.AABB",
    "godot.core.Basis",
    "godot.core.Transform",
    "godot.core.Color",
    "godot.core.NodePath",
    "godot.core.RID",
    "godot.Object",
    "godot.core.Dictionary",
    "godot.core.PoolByteArray",
    "godot.core.PoolIntArray",
    "godot.core.PoolRealArray",
    "godot.core.PoolStringArray",
    "godot.core.PoolColorArray",
    "godot.core.PoolVector2Array",
    "godot.core.PoolVector3Array",

    "godot.core.VariantArray",
    "godot.core.ObjectArray",
    "godot.core.EnumArray",
    "godot.core.BoolVariantArray",
    "godot.core.IntVariantArray",
    "godot.core.RealVariantArray",
    "godot.core.StringVariantArray",
    "godot.core.AABBArray",
    "godot.core.BasisArray",
    "godot.core.ColorArray",
    "godot.core.NodePathArray",
    "godot.core.PlaneArray",
    "godot.core.QuatArray",
    "godot.core.Rect2Array",
    "godot.core.RIDArray",
    "godot.core.Transform2DArray",
    "godot.core.TransformArray",
    "godot.core.Vector2Array",
    "godot.core.Vector3Array"
)


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/PropertyDescriptorExt.kt
================================================
package godot.entrygenerator.extension

import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.resolve.source.KotlinSourceElement

fun PropertyDescriptor.getPropertyHintAnnotation(): AnnotationDescriptor? {
    val propertyHintAnnotations = propertyHintAnnotations
        .map { FqName(it) }
        .filter { annotations.hasAnnotation(it) }
        .map { annotations.findAnnotation(it) }

    if (propertyHintAnnotations.size > 1) {
        throw IllegalStateException("The property ${this.name} has multiple PropertyHintAnnotations. You can only specify one! Defined Annotations: $propertyHintAnnotations")
    }

    if (propertyHintAnnotations.isNotEmpty() && !annotations.hasAnnotation(FqName("godot.annotation.RegisterProperty"))) {
        throw IllegalStateException("The property ${this.name} has a ${propertyHintAnnotations.first()?.fqName} annotation but is not annotated with @RegisterProperty. Add the @RegisterProperty annotation or remove the ${propertyHintAnnotations.first()?.fqName} annotation")
    }

    return propertyHintAnnotations.firstOrNull()
}

val PropertyDescriptor.assignmentPsi: KtExpression
    get() = ((this
        .source as KotlinSourceElement)
        .psi as KtProperty)
        .delegateExpressionOrInitializer!! // should not be null


private val propertyHintAnnotations: List<String> =
    listOf(
        "godot.annotation.ColorNoAlpha",
        "godot.annotation.Dir",
        "godot.annotation.DoubleRange",
        "godot.annotation.EnumFlag",
        "godot.annotation.ExpEasing",
        "godot.annotation.ExpRange",
        "godot.annotation.File",
        "godot.annotation.Flags",
        "godot.annotation.FloatRange",
        "godot.annotation.ImageCompressLossLess",
        "godot.annotation.ImageCompressLossy",
        "godot.annotation.IntFlag",
        "godot.annotation.IntIsObjectId",
        "godot.annotation.IntRange",
        "godot.annotation.Layers2DPhysics",
        "godot.annotation.Layers2DRender",
        "godot.annotation.Layers3DPhysics",
        "godot.annotation.Layers3DRender",
        "godot.annotation.Lenght",
        "godot.annotation.Max",
        "godot.annotation.MethodOfBaseType",
        "godot.annotation.MethodOfInstance",
        "godot.annotation.MethodOfScript",
        "godot.annotation.MethodOfVariantType",
        "godot.annotation.MultilineText",
        "godot.annotation.NodePathToEditedNode",
        "godot.annotation.NodePathValidTypes",
        "godot.annotation.ObjectId",
        "godot.annotation.ObjectTooBig",
        "godot.annotation.PlaceHolderText",
        "godot.annotation.PropertyOfBaseType",
        "godot.annotation.PropertyOfInstance",
        "godot.annotation.PropertyOfScript",
        "godot.annotation.PropertyOfVariantType",
        "godot.annotation.ResourceType",
        "godot.annotation.SaveFile",
        "godot.annotation.TypeString"
    )


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/StringExt.kt
================================================
package godot.entrygenerator.extension

fun String.isString() = this == "kotlin.String"

fun String.isGodotPrimitive() =
    when (this) {
        "kotlin.Int",
        "kotlin.Long",
        "kotlin.Float",
        "kotlin.Double",
        "kotlin.Boolean",
        "kotlin.Byte",
        "kotlin.Short",
        "kotlin.String" -> true
        else -> false
    }

fun String.getAsVariantTypeOrdinal() =
    when (this) {
        "kotlin.Boolean" -> "1"
        "kotlin.Int",
        "kotlin.Long",
        "kotlin.Byte",
        "kotlin.Short",
        "kotlin.Enum" -> "2"
        "kotlin.Float",
        "kotlin.Double" -> "3"
        "kotlin.String" -> "4"
        "godot.core.Vector2" -> "5"
        "godot.core.Rect2" -> "6"
        "godot.core.Vector3" -> "7"
        "godot.core.Transform2D" -> "8"
        "godot.core.Plane" -> "9"
        "godot.core.Quat" -> "10"
        "godot.core.AABB" -> "11"
        "godot.core.Basis" -> "12"
        "godot.core.Transform" -> "13"
        "godot.core.Color" -> "14"
        "godot.core.NodePath" -> "15"
        "godot.core.RID" -> "16"
        "godot.core.OBJECT" -> "17"
        "godot.core.Dictionary" -> "18"
        //Array -> handled in else branch
        "godot.core.PoolByteArray" -> "20"
        "godot.core.PoolIntArray" -> "21"
        "godot.core.PoolRealArray" -> "22"
        "godot.core.PoolStringArray" -> "23"
        "godot.core.PoolColorArray" -> "24"
        "godot.core.PoolVector2Array" -> "25"
        "godot.core.PoolVector3Array" -> "26"
        else -> if (this.isCompatibleListType()) {
            "19"
        } else {
            null
        }
    }

fun String.isCompatibleListType(): Boolean {
    return this.getCompatibleListType().isNotEmpty()
}

fun String.getCompatibleListType(): String {
    return when(this) {
        "godot.core.BoolVariantArray" -> "1"
        "godot.core.EnumArray",
        "godot.core.IntVariantArray" -> "2"
        "godot.core.RealVariantArray" -> "3"
        "godot.core.StringVariantArray" -> "4"
        "godot.core.Vector2Array" -> "5"
        "godot.core.Rect2Array" -> "6"
        "godot.core.Vector3Array" -> "7"
        "godot.core.Transform2DArray" -> "8"
        "godot.core.PlaneArray" -> "9"
        "godot.core.QuatArray" -> "10"
        "godot.core.AABBArray" -> "11"
        "godot.core.BasisArray" -> "12"
        "godot.core.TransformArray" -> "13"
        "godot.core.ColorArray" -> "14"
        "godot.core.NodePathArray" -> "15"
        "godot.core.RIDArray" -> "16"
        "godot.core.ObjectArray",
        "godot.core.CoreArray" -> "17"
        else -> ""
    }
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/filebuilder/EntryFileBuilder.kt
================================================
package godot.entrygenerator.filebuilder

import com.squareup.kotlinpoet.AnnotationSpec
import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.FileSpec
import com.squareup.kotlinpoet.FunSpec
import godot.entrygenerator.generator.ClassRegistrationGenerator
import godot.entrygenerator.model.ClassWithMembers
import org.jetbrains.kotlin.resolve.BindingContext
import java.io.File

class EntryFileBuilder(val bindingContext: BindingContext) {
    private val entryFileSpec = FileSpec
        .builder("godot", "Entry")
        .addAnnotation(
            AnnotationSpec
                .builder(ClassName("kotlin", "Suppress"))
                .addMember("%S", "EXPERIMENTAL_API_USAGE")
                .build()
        )
        .addComment("THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD")
        .addFunction(generateGDNativeInitFunction())
        .addFunction(generateGDNativeTerminateFunction())

    private val nativeScriptInitFunctionSpec = FunSpec
        .builder("NativeScriptInit")
        .addAnnotation(
            AnnotationSpec
                .builder(ClassName("kotlin.native", "CName"))
                .addMember("%S", "godot_nativescript_init")
                .build()
        )
        .addParameter("handle", ClassName("kotlinx.cinterop", "COpaquePointer"))
        .addStatement("%T.nativescriptInit(handle)", ClassName("godot.core", "Godot"))


    fun registerClassesWithMembers(classesWithMembers: Set<ClassWithMembers>): EntryFileBuilder {
        val classRegistryControlFlow = nativeScriptInitFunctionSpec
            .beginControlFlow(
                "with(%T(handle))·{",
                ClassName("godot.core", "ClassRegistry")
            ) //START: with ClassRegistry

        ClassRegistrationGenerator.registerClasses(classesWithMembers, classRegistryControlFlow, bindingContext)

        classRegistryControlFlow.endControlFlow() //END: with ClassRegistry

        return this
    }

    fun build(outputPath: String) {
        entryFileSpec.addFunction(nativeScriptInitFunctionSpec.build())
        entryFileSpec.addFunction(generateGDNativeScriptTerminateFunction())
        entryFileSpec.build().writeTo(File(outputPath))
    }

    private fun generateGDNativeInitFunction(): FunSpec {
        return FunSpec
            .builder("GDNativeInit")
            .addAnnotation(
                AnnotationSpec
                    .builder(ClassName("kotlin.native", "CName"))
                    .addMember("%S", "godot_gdnative_init")
                    .build()
            )
            .addParameter("options", ClassName("godot.gdnative", "godot_gdnative_init_options"))
            .addStatement("%T.init(options)", ClassName("godot.core", "Godot"))
            .build()
    }

    private fun generateGDNativeTerminateFunction(): FunSpec {
        return FunSpec
            .builder("GDNativeTerminate")
            .addAnnotation(
                AnnotationSpec
                    .builder(ClassName("kotlin.native", "CName"))
                    .addMember("%S", "godot_gdnative_terminate")
                    .build()
            )
            .addParameter("options", ClassName("godot.gdnative", "godot_gdnative_terminate_options"))
            .addStatement("%T.terminate(options)", ClassName("godot.core", "Godot"))
            .build()
    }

    private fun generateGDNativeScriptTerminateFunction(): FunSpec {
        return FunSpec
            .builder("NativeScriptTerminate")
            .addAnnotation(
                AnnotationSpec
                    .builder(ClassName("kotlin.native", "CName"))
                    .addMember("%S", "godot_nativescript_terminate")
                    .build()
            )
            .addParameter("handle", ClassName("kotlinx.cinterop", "COpaquePointer"))
            .addStatement("%T.nativescriptTerminate(handle)", ClassName("godot.core", "Godot"))
            .build()
    }
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/ClassRegistrationGenerator.kt
================================================
package godot.entrygenerator.generator

import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.FunSpec
import godot.entrygenerator.extension.getAnnotationValue
import godot.entrygenerator.extension.getSuperTypeNameAsString
import godot.entrygenerator.model.ClassWithMembers
import godot.entrygenerator.model.REGISTER_CLASS_ANNOTATION
import godot.entrygenerator.model.REGISTER_CLASS_ANNOTATION_TOOL_ARGUMENT
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe

object ClassRegistrationGenerator {

    fun registerClasses(
        classesWithMembers: Set<ClassWithMembers>,
        classRegistryControlFlow: FunSpec.Builder,
        bindingContext: BindingContext
    ) {
        classesWithMembers.forEach { classWithMembers ->
            val classNameAsString = classWithMembers.classDescriptor.name.asString()
            val packagePath = classWithMembers.classDescriptor.fqNameSafe.parent().asString()
            val className = ClassName(packagePath, classNameAsString)
            val superClass = classWithMembers.classDescriptor.getSuperTypeNameAsString()

            val registerClassControlFlow = classRegistryControlFlow.beginControlFlow(
                "registerClass(%S,·%S,·%L,·${isTool(classWithMembers.classDescriptor)})·{",
                classWithMembers.classDescriptor.fqNameSafe.asString(),
                superClass,
                className.constructorReference()
            ) //START: registerClass

            FunctionRegistrationGenerator.registerFunctions(
                classWithMembers.functions,
                registerClassControlFlow,
                className
            )

            SignalRegistrationGenerator.registerSignals(
                classWithMembers.signals,
                registerClassControlFlow
            )

            PropertyRegistrationGenerator.registerProperties(
                classWithMembers.properties,
                registerClassControlFlow,
                className,
                bindingContext
            )

            registerClassControlFlow.endControlFlow() //END: registerClass
        }
    }

    private fun isTool(classDescriptor: ClassDescriptor): Boolean {
        return classDescriptor
            .annotations
            .getAnnotationValue(REGISTER_CLASS_ANNOTATION, REGISTER_CLASS_ANNOTATION_TOOL_ARGUMENT, false)
    }
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/FunctionRegistrationGenerator.kt
================================================
package godot.entrygenerator.generator

import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.FunSpec
import com.squareup.kotlinpoet.MemberName.Companion.member
import com.squareup.kotlinpoet.TypeName
import com.squareup.kotlinpoet.asTypeName
import godot.entrygenerator.extension.getAnnotationValue
import godot.entrygenerator.extension.getFirstRegistrableTypeAsFqNameStringOrNull
import godot.entrygenerator.mapper.RpcModeAnnotationMapper.mapRpcModeAnnotationToClassName
import godot.entrygenerator.model.REGISTER_FUNCTION_ANNOTATION
import godot.entrygenerator.model.REGISTER_FUNCTION_ANNOTATION_RPC_MODE_ARGUMENT
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.js.descriptorUtils.getJetTypeFqName
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.supertypes

object FunctionRegistrationGenerator {

    fun registerFunctions(
        functions: List<FunctionDescriptor>,
        registerClassControlFlow: FunSpec.Builder,
        className: ClassName
    ) {
        functions.forEach { functionDescriptor ->
            val variantToTypeConverterList = getVariantTypeConverterList(functionDescriptor)
            val typeToVariantConverter = getTypeToVariantConverter(functionDescriptor)
            registerClassControlFlow
                .addStatement(
                    getFunctionTemplateString(functionDescriptor, typeToVariantConverter.first, variantToTypeConverterList.first),
                    functionDescriptor.name,
                    mapRpcModeAnnotationToClassName(getRpcModeEnum(functionDescriptor)),
                    className.member(functionDescriptor.name.asString()).reference(),
                    typeToVariantConverter.second,
                    *variantToTypeConverterList.second
                )
        }
    }

    private fun getFunctionTemplateString(
        functionDescriptor: FunctionDescriptor,
        typeToVariantConverter: String,
        variantToTypeConverterList: String
    ): String {
        return if (functionDescriptor.valueParameters.isEmpty()) {
            "function(%S,·%T,·%L,·$typeToVariantConverter)"
        } else {
            "function(%S,·%T,·%L,·$typeToVariantConverter,·$variantToTypeConverterList)"
        }
    }

    private fun getRpcModeEnum(functionDescriptor: FunctionDescriptor): String {
        val compilerRpcModeEnumRepresentation = getCompilerRpcModeEnumRepresentation(functionDescriptor)
        val packagePath = compilerRpcModeEnumRepresentation.first.asString().replace("/", ".")
        val name = compilerRpcModeEnumRepresentation.second
        return "$packagePath.$name"
    }

    private fun getCompilerRpcModeEnumRepresentation(functionDescriptor: FunctionDescriptor): Pair<ClassId, Name> {
        return functionDescriptor
            .annotations
            .getAnnotationValue(
                REGISTER_FUNCTION_ANNOTATION,
                REGISTER_FUNCTION_ANNOTATION_RPC_MODE_ARGUMENT,
                Pair(ClassId(FqName("godot.MultiplayerAPI"), Name.identifier("RPCMode")), Name.identifier("DISABLED"))
            )
    }

    private fun getVariantTypeConverterList(functionDescriptor: FunctionDescriptor): Pair<String, Array<TypeName>> {
        val templateArguments = mutableListOf<TypeName>()
        val template = buildString {
            append("listOf(")
            functionDescriptor.valueParameters.forEach {
                val firstRegistrableType = it.type.getFirstRegistrableTypeAsFqNameStringOrNull()
                    ?: throw IllegalArgumentException("Registered function \"${functionDescriptor.fqNameSafe}\" receives an unregistrable type: ${it.name}. All arguments of a registered functions have to be either primitive or derive from a Godot type")

                if (firstRegistrableType == "godot.core.EnumArray") {
                    throw IllegalArgumentException("Registered function \"${functionDescriptor.fqNameSafe}\" receives an EnumArray as param: ${it.name}. EnumArrays cannot be registered as params for functions. Use IntVariantArray instead.")
                }
                if (firstRegistrableType == "godot.core.ObjectArray") {
                    throw IllegalArgumentException("Registered function \"${functionDescriptor.fqNameSafe}\" receives an ObjectArray as param: ${it.name}. ObjectArray cannot be registered as params for functions. Use VariantArray instead and use the asObjectArray() function for conversion.")
                }

                val typeAsString = firstRegistrableType
                    .replaceBeforeLast(".", "")
                    .replace(".", "")

                val packageAsString = firstRegistrableType
                    .replaceAfterLast(".", "")

                val argumentTemplateString = if (typeAsString == "GodotArray") {
                    "getVariantToTypeConversionFunction<%T<*>>()"
                } else {
                    "getVariantToTypeConversionFunction<%T>()"
                }

                append(argumentTemplateString)
                templateArguments.add(ClassName(packageAsString, typeAsString))

                if (functionDescriptor.valueParameters.last() != it) {
                    append(",·")
                }
            }
            append(")")
        }
        return template to templateArguments.toTypedArray()
    }

    private fun getTypeToVariantConverter(functionDescriptor: FunctionDescriptor): Pair<String, ClassName> {
        return functionDescriptor.returnType?.let { returnType ->
            val className = when {
                isOfType(returnType, "godot.internal.type.CoreType") -> ClassName("godot.internal.type", "CoreType")
                isOfType(returnType, "godot.Object") -> ClassName("godot", "Object")
                isOfType(returnType, "godot.core.Variant") -> ClassName("godot.core", "Variant")
                KotlinBuiltIns.isInt(returnType) -> Int::class.asTypeName()
                KotlinBuiltIns.isLongOrNullableLong(returnType) -> Long::class.asTypeName()
                KotlinBuiltIns.isDoubleOrNullableDouble(returnType) -> Double::class.asTypeName()
                KotlinBuiltIns.isFloatOrNullableFloat(returnType) -> Float::class.asTypeName()
                KotlinBuiltIns.isBooleanOrNullableBoolean(returnType) -> Boolean::class.asTypeName()
                KotlinBuiltIns.isStringOrNullableString(returnType) -> String::class.asTypeName()
                KotlinBuiltIns.isUnit(returnType) -> null
                else -> throw IllegalArgumentException("Registered functions \"${functionDescriptor.fqNameSafe}\" return type is of unregistrable type: ${returnType}. You can only register functions which return either a primitive or a type derived from a Godot type")
            }

            className?.let {
                "getTypeToVariantConversionFunction<%T>()" to className
            } ?: "{·%T()·}" to ClassName("godot.core", "Variant")
        } ?: "{·%T()·}" to ClassName("godot.core", "Variant")
    }

    private fun isOfType(type: KotlinType, typeFqName: String): Boolean {
        return if (type.getJetTypeFqName(false) == typeFqName) {
            true
        } else {
            type
                .supertypes()
                .any { it.getJetTypeFqName(false) == typeFqName }
        }
    }
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/GdnsGenerator.kt
================================================
package godot.entrygenerator.generator

import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import java.io.File

object GdnsGenerator {

    fun generateGdnsFiles(
        outputPath: String,
        gdnLibFile: String,
        cleanGeneratedGdnsFiles: Boolean,
        classes: Set<ClassDescriptor>
    ) {
        val existingGdnsFiles = File(outputPath)
            .listFiles()
            ?.filter { it.extension == "gdns" }
            ?: emptyList()

        val classNames = classes.map { clazz -> clazz.name.asString() }
        val obsoleteGdnsFiles = existingGdnsFiles
            .filter { !classNames.contains(it.name) }

        if (cleanGeneratedGdnsFiles) {
            obsoleteGdnsFiles.forEach {
                it.delete()
            }
        }

        classes.forEach {
            val fqName = it.fqNameSafe.asString()

            File(getGdnsFilePath(outputPath, fqName).replaceAfterLast("/", "")).mkdirs()
            File(getGdnsFilePath(outputPath, fqName))
                .writeText(getGdnsFileContent(gdnLibFile, fqName))
        }
    }

    private fun getGdnsFileContent(gdnLibFile: String, classFqName: String): String {
        return """
            [gd_resource type="NativeScript" load_steps=2 format=2]

            [ext_resource path="res://$gdnLibFile" type="GDNativeLibrary" id=1]

            [resource]
            resource_name = "$classFqName"
            class_name = "$classFqName"
            library = ExtResource( 1 )
        """.trimIndent()
    }

    private fun getGdnsFilePath(outputPath: String, classFqName: String): String {
        return "$outputPath/${classFqName.replace(".", "/")}.gdns"
    }
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/PropertyRegistrationGenerator.kt
================================================
package godot.entrygenerator.generator

import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.FunSpec
import com.squareup.kotlinpoet.MemberName.Companion.member
import com.squareup.kotlinpoet.asTypeName
import godot.entrygenerator.extension.getAnnotationValue
import godot.entrygenerator.extension.getFirstRegistrableTypeAsFqNameStringOrNull
import godot.entrygenerator.extension.isCompatibleList
import godot.entrygenerator.generator.provider.DefaultValueHandlerProvider
import godot.entrygenerator.mapper.RpcModeAnnotationMapper.mapRpcModeAnnotationToClassName
import godot.entrygenerator.mapper.TypeToVariantAsClassNameMapper
import godot.entrygenerator.model.REGISTER_PROPERTY_ANNOTATION
import godot.entrygenerator.model.REGISTER_PROPERTY_ANNOTATION_RPC_MODE_ARGUMENT
import godot.entrygenerator.model.REGISTER_PROPERTY_ANNOTATION_VISIBLE_IN_EDITOR_ARGUMENT
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.js.descriptorUtils.getJetTypeFqName
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.isEnum
import org.jetbrains.kotlin.types.typeUtil.supertypes

object PropertyRegistrationGenerator {

    fun registerProperties(
        properties: List<PropertyDescriptor>,
        registerClassControlFlow: FunSpec.Builder,
        className: ClassName,
        bindingContext: BindingContext
    ) {
        properties.forEach { propertyDescriptor ->
            if (propertyDescriptor.type.isEnum()) {
                registerEnum(className, propertyDescriptor, bindingContext, registerClassControlFlow)
            } else if (propertyDescriptor.type.isCompatibleList() && propertyDescriptor.type.arguments.firstOrNull()?.type?.isEnum() == true) {
                registerEnumList(className, propertyDescriptor, bindingContext, registerClassControlFlow)
            } else if (
                KotlinBuiltIns.isSetOrNullableSet(propertyDescriptor.type)
                && propertyDescriptor.type.arguments.firstOrNull()?.type?.isEnum() == true
            ) {
                registerEnumFlag(className, propertyDescriptor, bindingContext, registerClassControlFlow)
            } else {
                registerProperty(className, propertyDescriptor, bindingContext, registerClassControlFlow)
            }
        }
    }

    private fun registerEnumFlag(
        className: ClassName,
        propertyDescriptor: PropertyDescriptor,
        bindingContext: BindingContext,
        registerClassControlFlow: FunSpec.Builder
    ) {
        val defaultValueProvider =
            DefaultValueHandlerProvider.provideDefaultValueHandler(propertyDescriptor, bindingContext)
        val (defaultValueStringTemplate, defaultValueStringTemplateValues) = defaultValueProvider.getDefaultValue()

        registerClassControlFlow.addStatement(
            "enumFlagProperty(%S,·%L,·${defaultValueStringTemplate.replace(" ", "·")},·%L,·%T)",
            propertyDescriptor.name,
            className.member(propertyDescriptor.name.asString()).reference(),
            *defaultValueStringTemplateValues,
            shouldBeVisibleInEditor(propertyDescriptor),
            mapRpcModeAnnotationToClassName(getRpcModeEnum(propertyDescriptor))
        )
    }

    private fun registerEnumList(
        className: ClassName,
        propertyDescriptor: PropertyDescriptor,
        bindingContext: BindingContext,
        registerClassControlFlow: FunSpec.Builder
    ) {
        val defaultValueProvider =
            DefaultValueHandlerProvider.provideDefaultValueHandler(propertyDescriptor, bindingContext)
        val (defaultValueStringTemplate, defaultValueStringTemplateValues) = defaultValueProvider.getDefaultValue()

        registerClassControlFlow.addStatement(
            "enumListProperty(%S,·%L,·${defaultValueStringTemplate.replace(" ", "·")},·%L,·%T)",
            propertyDescriptor.name,
            className.member(propertyDescriptor.name.asString()).reference(),
            *defaultValueStringTemplateValues,
            shouldBeVisibleInEditor(propertyDescriptor),
            mapRpcModeAnnotationToClassName(getRpcModeEnum(propertyDescriptor))
        )
    }

    private fun registerEnum(
        className: ClassName,
        propertyDescriptor: PropertyDescriptor,
        bindingContext: BindingContext,
        registerClassControlFlow: FunSpec.Builder
    ) {
        val defaultValueProvider =
            DefaultValueHandlerProvider.provideDefaultValueHandler(propertyDescriptor, bindingContext)
        val (defaultValueStringTemplate, defaultValueStringTemplateValues) = defaultValueProvider.getDefaultValue()

        registerClassControlFlow
            .addStatement(
                "enumProperty(%S,·%L,·${defaultValueStringTemplate.replace(" ", "·")},·%L,·%T)",
                propertyDescriptor.name,
                className.member(propertyDescriptor.name.asString()).reference(),
                *defaultValueStringTemplateValues,
                shouldBeVisibleInEditor(propertyDescriptor),
                mapRpcModeAnnotationToClassName(getRpcModeEnum(propertyDescriptor))
            )
    }

    private fun registerProperty(
        className: ClassName,
        propertyDescriptor: PropertyDescriptor,
        bindingContext: BindingContext,
        registerClassControlFlow: FunSpec.Builder
    ) {
        val defaultValueProvider = DefaultValueHandlerProvider.provideDefaultValueHandler(
            propertyDescriptor,
            bindingContext
        )
        val (defaultValueStringTemplate, defaultValueStringTemplateValues) = defaultValueProvider.getDefaultValue()
        val (variantToTypeTemplate, variantToTypeTemplateValue) = getVariantToTypeConverter(propertyDescriptor)
        val (typeToVariantTemplate, typeToVariantTemplateValue) = getTypeToVariantConverter(propertyDescriptor)
        val hintString = defaultValueProvider.getHintString()

        registerClassControlFlow
            .addStatement(
                "property(%S,·%L,·$typeToVariantTemplate,·$variantToTypeTemplate,·%T,·${defaultValueStringTemplate.replace(" ", "·")},·%L,·%T,·%T,·%S)",
                propertyDescriptor.name,
                className.member(propertyDescriptor.name.asString()).reference(),
                typeToVariantTemplateValue,
                variantToTypeTemplateValue,
                TypeToVariantAsClassNameMapper.mapTypeToVariantAsClassName(
                    propertyDescriptor.type.toString(),
                    propertyDescriptor.type,
                    propertyDescriptor.type.isEnum()
                ), //property variant type
                *defaultValueStringTemplateValues,
                shouldBeVisibleInEditor(propertyDescriptor),
                mapRpcModeAnnotationToClassName(getRpcModeEnum(propertyDescriptor)),
                defaultValueProvider.getPropertyTypeHint(),
                hintString
            )
    }

    private fun shouldBeVisibleInEditor(propertyDescriptor: PropertyDescriptor): Boolean {
        return propertyDescriptor
            .annotations
            .getAnnotationValue(
                REGISTER_PROPERTY_ANNOTATION,
                REGISTER_PROPERTY_ANNOTATION_VISIBLE_IN_EDITOR_ARGUMENT,
                true
            )
    }

    private fun getRpcModeEnum(propertyDescriptor: PropertyDescriptor): String {
        val compilerRpcModeEnumRepresentation = getCompilerRpcModeEnumRepresentation(propertyDescriptor)
        val packagePath = compilerRpcModeEnumRepresentation.first.asString().replace("/", ".")
        val name = compilerRpcModeEnumRepresentation.second
        return "$packagePath.$name"
    }

    private fun getCompilerRpcModeEnumRepresentation(propertyDescriptor: PropertyDescriptor): Pair<ClassId, Name> {
        return propertyDescriptor
            .annotations
            .getAnnotationValue(
                REGISTER_PROPERTY_ANNOTATION,
                REGISTER_PROPERTY_ANNOTATION_RPC_MODE_ARGUMENT,
                Pair(ClassId(FqName("godot.MultiplayerAPI"), Name.identifier("RPCMode")), Name.identifier("DISABLED"))
            )
    }

    private fun getVariantToTypeConverter(propertyDescriptor: PropertyDescriptor): Pair<String, ClassName> {
        val firstRegistrableType = propertyDescriptor.type.getFirstRegistrableTypeAsFqNameStringOrNull()
            ?: throw IllegalArgumentException("Registered property \"${propertyDescriptor.fqNameSafe}\" is of unregistrable type: ${propertyDescriptor.type}. You can only register properties which are either primitive or derive from a Godot type")

        if (firstRegistrableType == "godot.core.ObjectArray") {
            throw IllegalArgumentException("Registered property \"${propertyDescriptor.fqNameSafe}\" is of type ObjectArray. ObjectArray cannot be registered directly. Use VariantArray instead and use the asObjectArray() function for conversion.")
        }

        val typeAsString = firstRegistrableType
            .replaceBeforeLast(".", "")
            .replace(".", "")

        val packageAsString = firstRegistrableType
            .replaceAfterLast(".", "")

        val argumentTemplateString = if (typeAsString == "GodotArray") {
            "getVariantToTypeConversionFunction<%T<*>>()"
        } else {
            "getVariantToTypeConversionFunction<%T>()"
        }

        return argumentTemplateString to ClassName(packageAsString, typeAsString)
    }

    private fun getTypeToVariantConverter(propertyDescriptor: PropertyDescriptor): Pair<String, ClassName> {
        val className = when {
            isOfType(propertyDescriptor.type, "godot.internal.type.CoreType") -> ClassName("godot.internal.type", "CoreType")
            isOfType(propertyDescriptor.type, "godot.Object") -> ClassName("godot", "Object")
            isOfType(propertyDescriptor.type, "godot.core.Variant") -> ClassName("godot.core", "Variant")
            KotlinBuiltIns.isInt(propertyDescriptor.type) -> Int::class.asTypeName()
            KotlinBuiltIns.isLongOrNullableLong(propertyDescriptor.type) -> Long::class.asTypeName()
            KotlinBuiltIns.isDoubleOrNullableDouble(propertyDescriptor.type) -> Double::class.asTypeName()
            KotlinBuiltIns.isFloatOrNullableFloat(propertyDescriptor.type) -> Float::class.asTypeName()
            KotlinBuiltIns.isBooleanOrNullableBoolean(propertyDescriptor.type) -> Boolean::class.asTypeName()
            KotlinBuiltIns.isStringOrNullableString(propertyDescriptor.type) -> String::class.asTypeName()
            else -> throw IllegalArgumentException("Registered property \"${propertyDescriptor.fqNameSafe}\" is of unregistrable type: ${propertyDescriptor.type}. You can only register properties which are either primitive or derive from a Godot type")
        }

        return "getTypeToVariantConversionFunction<%T>()" to className
    }

    private fun isOfType(type: KotlinType, typeFqName: String): Boolean {
       return if (type.getJetTypeFqName(false) == typeFqName) {
            true
        } else {
            type
                .supertypes()
                .any { it.getJetTypeFqName(false) == typeFqName }
        }
    }
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/SignalRegistrationGenerator.kt
================================================
package godot.entrygenerator.generator

import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.FunSpec
import godot.entrygenerator.mapper.TypeToVariantAsClassNameMapper
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.psi.KtTypeArgumentList
import org.jetbrains.kotlin.psi.KtValueArgumentList
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.source.KotlinSourceElement

object SignalRegistrationGenerator {

    fun registerSignals(
        signals: List<PropertyDescriptor>,
        registerClassControlFlow: FunSpec.Builder
    ) {
        signals.forEach { propertyDescriptor ->
            signalSanityCheck(propertyDescriptor)

            val (signalArgumentsStringTemplate, arrayOfClassNames) = getSignalArguments(propertyDescriptor)

            registerClassControlFlow
                .addStatement(
                    "signal(%S,·$signalArgumentsStringTemplate)",
                    propertyDescriptor.name,
                    *arrayOfClassNames
                )
        }
    }

    private fun signalSanityCheck(propertyDescriptor: PropertyDescriptor) {
        val propertyTypeAsString = propertyDescriptor.type.toString()

        if (!propertyDescriptor.name.asString().startsWith("signal")) {
            throw IllegalStateException("All signals must be prefixed with \"signal\"! Ex: signalButtonPressed. The signal ${propertyDescriptor.fqNameSafe} does not fulfill this criteria.")
        }

        if (propertyTypeAsString.startsWith("Signal")) {
            try {
                propertyTypeAsString.replace("Signal", "").split("<")[0].toInt()
            } catch (e: NumberFormatException) {
                throw IllegalStateException("You annotated ${propertyDescriptor.fqNameSafe} with @RegisterSignal but it's type is no signal! Use \"by signal\" to define signals.")
            }
        } else {
            throw IllegalStateException("You annotated ${propertyDescriptor.fqNameSafe} with @RegisterSignal but it's type is no signal! Use \"by signal\" to define signals.")
        }
    }

    private fun getSignalArguments(propertyDescriptor: PropertyDescriptor): Pair<String, Array<ClassName>> {
        val signalDelegate = (propertyDescriptor
            .source as KotlinSourceElement)
            .psi // whole property including annotation
            .children
            .last() // property delegate including `by`keyword. Ex: by signal<Boolean>("someName")
            .children
            .last() // property delegate. EX: signal<Boolean>("someName")

        return if (signalDelegate.children.any { it is KtTypeArgumentList }) { //if the signal has any arguments
            val typeArgumentsAsClassNames = signalDelegate
                .children
                .filterIsInstance<KtTypeArgumentList>()
                .first() //the type argument list. Ex: <Boolean, String>
                .children
                .map { it.text } //extracted each type argument as string
                .map {
                    TypeToVariantAsClassNameMapper.mapTypeToVariantAsClassName(it) //convert string to ClassName for kotlinPoet to get correct imports
                }
                .toTypedArray() //convert to typed array to pass as varargs to kotlinPoet addStatement function

            val valueArgumentsAsString = signalDelegate
                .children
                .filterIsInstance<KtValueArgumentList>()
                .first() //the value argument list. Ex: ("name1", "name2")
                .children
                .map { it.text } //extracted each value argument as string


            if (typeArgumentsAsClassNames.size != valueArgumentsAsString.size) {
                throw IllegalStateException("The value argument list has not the same size as the type argument list in this signal declaration: ${signalDelegate.text}")
            }

            Pair(assembleSignalParameterMapStringTemplate(valueArgumentsAsString), typeArgumentsAsClassNames)
        } else { //if the signal does not have any arguments, an empty map will be passed to the registration
            Pair("mapOf()", arrayOf())
        }
    }

    private fun assembleSignalParameterMapStringTemplate(
        valueArgumentsAsString: List<String>
    ): String {
        return buildString {
            append("mapOf(")

            valueArgumentsAsString.forEachIndexed { index, valueArgumentAsString ->
                append("$valueArgumentAsString·to·%T")

                if (index != valueArgumentsAsString.size - 1) {
                    append(",·")
                }
            }

            append(")")
        }
    }
}


================================================
FILE: entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/ArrayRegistrationValuesHandler.kt
================================================
package godot.entrygenerator.generator.provider

import com.squareup.kotlinpoet.ClassName
import godot.entrygenerator.exceptions.WrongAnnotationUsageException
import godot.entrygenerator.extension.*
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.js.descriptorUtils.getJetTypeFqName
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.isEnum

class ArrayRegistrationValuesHandler(
    propertyDescriptor: PropertyDescriptor,
    bindingContext: BindingContext
) : RegistrationValuesHandler(propertyDescriptor, bindingContext) {
    override fun getPropertyTypeHint(): ClassName {
        return when (propertyHintAnnotation?.fqName?.asString()) {
            null -> ClassName("godot.gdnative.godot_property_hint", "GODOT_PROPERTY_HINT_NONE")
            else -> throw WrongAnnotationUsageException(propertyDescriptor, propertyHintAnnotation)
        }
    }

    override fun getDefaultValue(): Pair<String, Array<out Any>> {
        return if (propertyDescriptor.type.arguments.firstOrNull()?.type?.isEnum() == true) {
            if (propertyDescriptor.isLateInit || !isVisibleInEditor()) {
                return "%L" to arrayOf("null")
            }
            getDefaultValueExpression(propertyDescriptor.assignmentPsi) ?: throw IllegalStateException("") //TODO: error
        } else {
            super.getDefaultValue()
        }
    }

    /**
     * Hint string array formatting: https://github.com/godotengine/godot/blob/00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8/editor/editor_properties_array_dict.cpp
     */
    override fun getHintString(): String {
        // at this point we know type is a VariantArray
        val type = propertyDescriptor.type

        val elemen
Download .txt
gitextract_19j7ugkt/

├── .editorconfig
├── .gitattributes
├── .github/
│   ├── CODEOWNERS
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   ├── bin/
│   │   └── check-repo-is-clean.sh
│   └── workflows/
│       ├── CI.yaml
│       ├── check-pr-annotation-processor.yaml
│       ├── check-pr-build-props.yaml
│       ├── check-pr-codegen-uptodate.yaml
│       ├── check-pr-compiler-native-plugin.yaml
│       ├── check-pr-compiler-plugin-common.yaml
│       ├── check-pr-compiler-plugin.yaml
│       ├── check-pr-core.yaml
│       ├── check-pr-entry-generator.yaml
│       ├── check-pr-gradle-plugin.yaml
│       ├── check-pr-samples-3d-platformer.yaml
│       └── check-pr-samples-mini-games.yaml
├── .gitignore
├── .gitmodules
├── .readthedocs.yml
├── LICENSE
├── README.md
├── build.gradle.kts
├── buildSrc/
│   ├── build.gradle.kts
│   └── src/
│       └── main/
│           └── kotlin/
│               ├── BintrayPublish.kt
│               ├── DependenciesVersions.kt
│               ├── godot/
│               │   ├── codegen/
│               │   │   ├── Argument.kt
│               │   │   ├── Class.kt
│               │   │   ├── Enum.kt
│               │   │   ├── Graph.kt
│               │   │   ├── ICall.kt
│               │   │   ├── Method.kt
│               │   │   ├── Property.kt
│               │   │   ├── Signal.kt
│               │   │   ├── SignalArgument.kt
│               │   │   ├── TypeCast.kt
│               │   │   └── generationEntry.kt
│               │   └── tasks/
│               │       └── GenerateApiTask.kt
│               └── os.kt
├── design-docs/
│   ├── ABOUT.md
│   └── dictionary.md
├── docs/
│   ├── .gitignore
│   ├── SUMMARY.md
│   ├── build.sh
│   ├── mkdocs.yml
│   ├── requirements.txt
│   ├── run.sh
│   └── src/
│       └── doc/
│           ├── api-differences.md
│           ├── contribution.md
│           ├── index.md
│           ├── setup/
│           │   ├── gradle.md
│           │   └── ide.md
│           ├── supported-platforms.md
│           └── user-guide/
│               ├── classes.md
│               ├── methods.md
│               ├── properties.md
│               └── signals.md
├── entry-generation/
│   ├── godot-annotation-processor/
│   │   ├── build.gradle.kts
│   │   └── src/
│   │       └── main/
│   │           └── kotlin/
│   │               └── godot/
│   │                   └── annotation/
│   │                       └── processor/
│   │                           └── GodotAnnotationProcessor.kt
│   ├── godot-compiler-native-plugin/
│   │   ├── build.gradle.kts
│   │   └── src/
│   │       └── main/
│   │           ├── kotlin/
│   │           │   └── godot/
│   │           │       └── compiler/
│   │           │           └── plugin/
│   │           │               └── NativeComponentRegistrar.kt
│   │           └── resources/
│   │               └── META-INF/
│   │                   └── services/
│   │                       ├── org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
│   │                       └── org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
│   ├── godot-compiler-plugin/
│   │   ├── build.gradle.kts
│   │   └── src/
│   │       └── main/
│   │           ├── kotlin/
│   │           │   └── godot/
│   │           │       └── compiler/
│   │           │           └── plugin/
│   │           │               └── CommonComponentRegistrar.kt
│   │           └── resources/
│   │               └── META-INF/
│   │                   └── services/
│   │                       ├── org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
│   │                       └── org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
│   ├── godot-compiler-plugin-common/
│   │   ├── build.gradle.kts
│   │   └── src/
│   │       └── main/
│   │           └── kotlin/
│   │               └── godot/
│   │                   └── compiler/
│   │                       └── plugin/
│   │                           └── CompilerPluginConst.kt
│   └── godot-entry-generator/
│       ├── build.gradle.kts
│       └── src/
│           └── main/
│               └── kotlin/
│                   └── godot/
│                       └── entrygenerator/
│                           ├── EntryGenerator.kt
│                           ├── exceptions/
│                           │   └── WrongAnnotationUsageException.kt
│                           ├── extension/
│                           │   ├── AnnotationExt.kt
│                           │   ├── ClassDescriptorExt.kt
│                           │   ├── KotlinTypeExt.kt
│                           │   ├── PropertyDescriptorExt.kt
│                           │   └── StringExt.kt
│                           ├── filebuilder/
│                           │   └── EntryFileBuilder.kt
│                           ├── generator/
│                           │   ├── ClassRegistrationGenerator.kt
│                           │   ├── FunctionRegistrationGenerator.kt
│                           │   ├── GdnsGenerator.kt
│                           │   ├── PropertyRegistrationGenerator.kt
│                           │   ├── SignalRegistrationGenerator.kt
│                           │   └── provider/
│                           │       ├── ArrayRegistrationValuesHandler.kt
│                           │       ├── CoreTypeRegistrationValuesHandler.kt
│                           │       ├── DefaultValueHandlerProvider.kt
│                           │       ├── EnumFlagRegistrationValuesHandler.kt
│                           │       ├── EnumRegistrationValuesHandler.kt
│                           │       ├── IntFlagRegistrationValuesHandler.kt
│                           │       ├── MultiLineTextRegistrationValuesHandler.kt
│                           │       ├── PlaceholderTextRegistrationValuesHandler.kt
│                           │       ├── PrimitiveRegistrationValuesHandler.kt
│                           │       ├── RegistrationValuesHandler.kt
│                           │       └── ResourceRegistrationValuesHandler.kt
│                           ├── mapper/
│                           │   ├── PropertyHintTypeMapper.kt
│                           │   ├── RpcModeAnnotationMapper.kt
│                           │   └── TypeToVariantAsClassNameMapper.kt
│                           ├── model/
│                           │   ├── Annotations.kt
│                           │   └── ClassWithMembers.kt
│                           └── transformer/
│                               └── TypeDeclarationsToClassWithMemberTransformer.kt
├── godot-kotlin/
│   └── godot-library/
│       ├── build.gradle.kts
│       └── src/
│           ├── nativeCore/
│           │   └── kotlin/
│           │       └── godot/
│           │           └── core/
│           │               ├── ClassHandle.kt
│           │               ├── ClassRegistry.kt
│           │               ├── Godot.kt
│           │               ├── IndexedIterator.kt
│           │               ├── MethodBindCache.kt
│           │               ├── TypeManager.kt
│           │               ├── Wrapper.kt
│           │               ├── bridge.kt
│           │               ├── caseConverterExt.kt
│           │               ├── classBuilderDsl.kt
│           │               ├── functions.kt
│           │               ├── properties.kt
│           │               ├── signalProviders.kt
│           │               ├── signals.kt
│           │               ├── type/
│           │               │   ├── AABB.kt
│           │               │   ├── Basis.kt
│           │               │   ├── Color.kt
│           │               │   ├── Dictionary.kt
│           │               │   ├── GdString.kt
│           │               │   ├── GodotArray.kt
│           │               │   ├── NodePath.kt
│           │               │   ├── Plane.kt
│           │               │   ├── Quat.kt
│           │               │   ├── RID.kt
│           │               │   ├── Rect2.kt
│           │               │   ├── Transform.kt
│           │               │   ├── Transform2D.kt
│           │               │   ├── Variant.kt
│           │               │   ├── Vector2.kt
│           │               │   ├── Vector3.kt
│           │               │   ├── array/
│           │               │   │   ├── EnumArray.kt
│           │               │   │   ├── ObjectArray.kt
│           │               │   │   ├── VariantArray.kt
│           │               │   │   ├── core/
│           │               │   │   │   ├── AABBArray.kt
│           │               │   │   │   ├── BasisArray.kt
│           │               │   │   │   ├── ColorArray.kt
│           │               │   │   │   ├── CoreArray.kt
│           │               │   │   │   ├── NodePathArray.kt
│           │               │   │   │   ├── PlaneArray.kt
│           │               │   │   │   ├── QuatArray.kt
│           │               │   │   │   ├── RIDArray.kt
│           │               │   │   │   ├── Rect2Array.kt
│           │               │   │   │   ├── Transform2DArray.kt
│           │               │   │   │   ├── TransformArray.kt
│           │               │   │   │   ├── Vector2Array.kt
│           │               │   │   │   └── Vector3Array.kt
│           │               │   │   └── primitive/
│           │               │   │       ├── BoolVariantArray.kt
│           │               │   │       ├── IntVariantArray.kt
│           │               │   │       ├── RealVariantArray.kt
│           │               │   │       └── StringVariantArray.kt
│           │               │   ├── pool/
│           │               │   │   ├── PoolByteArray.kt
│           │               │   │   ├── PoolColorArray.kt
│           │               │   │   ├── PoolIntArray.kt
│           │               │   │   ├── PoolRealArray.kt
│           │               │   │   ├── PoolStringArray.kt
│           │               │   │   ├── PoolVector2Array.kt
│           │               │   │   └── PoolVector3Array.kt
│           │               │   └── string/
│           │               │       ├── File.kt
│           │               │       ├── Hash.kt
│           │               │       ├── UnEscape.kt
│           │               │       ├── Util.kt
│           │               │       └── Validation.kt
│           │               ├── typealias.kt
│           │               └── variantTypeMapping.kt
│           ├── nativeGen/
│           │   └── kotlin/
│           │       └── godot/
│           │           ├── ARVRAnchor.kt
│           │           ├── ARVRCamera.kt
│           │           ├── ARVRController.kt
│           │           ├── ARVRInterface.kt
│           │           ├── ARVRInterfaceGDNative.kt
│           │           ├── ARVROrigin.kt
│           │           ├── ARVRPositionalTracker.kt
│           │           ├── ARVRServer.kt
│           │           ├── AStar.kt
│           │           ├── AStar2D.kt
│           │           ├── AcceptDialog.kt
│           │           ├── AnimatedSprite.kt
│           │           ├── AnimatedSprite3D.kt
│           │           ├── AnimatedTexture.kt
│           │           ├── Animation.kt
│           │           ├── AnimationNode.kt
│           │           ├── AnimationNodeAdd2.kt
│           │           ├── AnimationNodeAdd3.kt
│           │           ├── AnimationNodeAnimation.kt
│           │           ├── AnimationNodeBlend2.kt
│           │           ├── AnimationNodeBlend3.kt
│           │           ├── AnimationNodeBlendSpace1D.kt
│           │           ├── AnimationNodeBlendSpace2D.kt
│           │           ├── AnimationNodeBlendTree.kt
│           │           ├── AnimationNodeOneShot.kt
│           │           ├── AnimationNodeOutput.kt
│           │           ├── AnimationNodeStateMachine.kt
│           │           ├── AnimationNodeStateMachinePlayback.kt
│           │           ├── AnimationNodeStateMachineTransition.kt
│           │           ├── AnimationNodeTimeScale.kt
│           │           ├── AnimationNodeTimeSeek.kt
│           │           ├── AnimationNodeTransition.kt
│           │           ├── AnimationPlayer.kt
│           │           ├── AnimationRootNode.kt
│           │           ├── AnimationTrackEditPlugin.kt
│           │           ├── AnimationTree.kt
│           │           ├── AnimationTreePlayer.kt
│           │           ├── Area.kt
│           │           ├── Area2D.kt
│           │           ├── ArrayMesh.kt
│           │           ├── AtlasTexture.kt
│           │           ├── AudioBusLayout.kt
│           │           ├── AudioEffect.kt
│           │           ├── AudioEffectAmplify.kt
│           │           ├── AudioEffectBandLimitFilter.kt
│           │           ├── AudioEffectBandPassFilter.kt
│           │           ├── AudioEffectChorus.kt
│           │           ├── AudioEffectCompressor.kt
│           │           ├── AudioEffectDelay.kt
│           │           ├── AudioEffectDistortion.kt
│           │           ├── AudioEffectEQ.kt
│           │           ├── AudioEffectEQ10.kt
│           │           ├── AudioEffectEQ21.kt
│           │           ├── AudioEffectEQ6.kt
│           │           ├── AudioEffectFilter.kt
│           │           ├── AudioEffectHighPassFilter.kt
│           │           ├── AudioEffectHighShelfFilter.kt
│           │           ├── AudioEffectInstance.kt
│           │           ├── AudioEffectLimiter.kt
│           │           ├── AudioEffectLowPassFilter.kt
│           │           ├── AudioEffectLowShelfFilter.kt
│           │           ├── AudioEffectNotchFilter.kt
│           │           ├── AudioEffectPanner.kt
│           │           ├── AudioEffectPhaser.kt
│           │           ├── AudioEffectPitchShift.kt
│           │           ├── AudioEffectRecord.kt
│           │           ├── AudioEffectReverb.kt
│           │           ├── AudioEffectSpectrumAnalyzer.kt
│           │           ├── AudioEffectSpectrumAnalyzerInstance.kt
│           │           ├── AudioEffectStereoEnhance.kt
│           │           ├── AudioServer.kt
│           │           ├── AudioStream.kt
│           │           ├── AudioStreamGenerator.kt
│           │           ├── AudioStreamGeneratorPlayback.kt
│           │           ├── AudioStreamMicrophone.kt
│           │           ├── AudioStreamOGGVorbis.kt
│           │           ├── AudioStreamPlayback.kt
│           │           ├── AudioStreamPlaybackResampled.kt
│           │           ├── AudioStreamPlayer.kt
│           │           ├── AudioStreamPlayer2D.kt
│           │           ├── AudioStreamPlayer3D.kt
│           │           ├── AudioStreamRandomPitch.kt
│           │           ├── AudioStreamSample.kt
│           │           ├── BackBufferCopy.kt
│           │           ├── BakedLightmap.kt
│           │           ├── BakedLightmapData.kt
│           │           ├── BaseButton.kt
│           │           ├── BitMap.kt
│           │           ├── BitmapFont.kt
│           │           ├── Bone2D.kt
│           │           ├── BoneAttachment.kt
│           │           ├── BoxContainer.kt
│           │           ├── BoxShape.kt
│           │           ├── BulletPhysicsDirectBodyState.kt
│           │           ├── Button.kt
│           │           ├── ButtonGroup.kt
│           │           ├── CPUParticles.kt
│           │           ├── CPUParticles2D.kt
│           │           ├── CSGBox.kt
│           │           ├── CSGCombiner.kt
│           │           ├── CSGCylinder.kt
│           │           ├── CSGMesh.kt
│           │           ├── CSGPolygon.kt
│           │           ├── CSGPrimitive.kt
│           │           ├── CSGShape.kt
│           │           ├── CSGSphere.kt
│           │           ├── CSGTorus.kt
│           │           ├── Camera.kt
│           │           ├── Camera2D.kt
│           │           ├── CameraFeed.kt
│           │           ├── CameraServer.kt
│           │           ├── CameraTexture.kt
│           │           ├── CanvasItem.kt
│           │           ├── CanvasItemMaterial.kt
│           │           ├── CanvasLayer.kt
│           │           ├── CanvasModulate.kt
│           │           ├── CapsuleMesh.kt
│           │           ├── CapsuleShape.kt
│           │           ├── CapsuleShape2D.kt
│           │           ├── CenterContainer.kt
│           │           ├── CharFXTransform.kt
│           │           ├── CheckBox.kt
│           │           ├── CheckButton.kt
│           │           ├── CircleShape2D.kt
│           │           ├── ClassDB.kt
│           │           ├── ClippedCamera.kt
│           │           ├── CollisionObject.kt
│           │           ├── CollisionObject2D.kt
│           │           ├── CollisionPolygon.kt
│           │           ├── CollisionPolygon2D.kt
│           │           ├── CollisionShape.kt
│           │           ├── CollisionShape2D.kt
│           │           ├── ColorPicker.kt
│           │           ├── ColorPickerButton.kt
│           │           ├── ColorRect.kt
│           │           ├── ConcavePolygonShape.kt
│           │           ├── ConcavePolygonShape2D.kt
│           │           ├── ConeTwistJoint.kt
│           │           ├── ConfigFile.kt
│           │           ├── ConfirmationDialog.kt
│           │           ├── Container.kt
│           │           ├── Control.kt
│           │           ├── ConvexPolygonShape.kt
│           │           ├── ConvexPolygonShape2D.kt
│           │           ├── Crypto.kt
│           │           ├── CryptoKey.kt
│           │           ├── CubeMap.kt
│           │           ├── CubeMesh.kt
│           │           ├── Curve.kt
│           │           ├── Curve2D.kt
│           │           ├── Curve3D.kt
│           │           ├── CurveTexture.kt
│           │           ├── CylinderMesh.kt
│           │           ├── CylinderShape.kt
│           │           ├── DTLSServer.kt
│           │           ├── DampedSpringJoint2D.kt
│           │           ├── DirectionalLight.kt
│           │           ├── Directory.kt
│           │           ├── DynamicFont.kt
│           │           ├── DynamicFontData.kt
│           │           ├── EditorExportPlugin.kt
│           │           ├── EditorFeatureProfile.kt
│           │           ├── EditorFileDialog.kt
│           │           ├── EditorFileSystem.kt
│           │           ├── EditorFileSystemDirectory.kt
│           │           ├── EditorImportPlugin.kt
│           │           ├── EditorInspector.kt
│           │           ├── EditorInspectorPlugin.kt
│           │           ├── EditorInterface.kt
│           │           ├── EditorNavigationMeshGenerator.kt
│           │           ├── EditorPlugin.kt
│           │           ├── EditorProperty.kt
│           │           ├── EditorResourceConversionPlugin.kt
│           │           ├── EditorResourcePreview.kt
│           │           ├── EditorResourcePreviewGenerator.kt
│           │           ├── EditorSceneImporter.kt
│           │           ├── EditorSceneImporterAssimp.kt
│           │           ├── EditorScenePostImport.kt
│           │           ├── EditorScript.kt
│           │           ├── EditorSelection.kt
│           │           ├── EditorSettings.kt
│           │           ├── EditorSpatialGizmo.kt
│           │           ├── EditorSpatialGizmoPlugin.kt
│           │           ├── EditorSpinSlider.kt
│           │           ├── EditorVCSInterface.kt
│           │           ├── EncodedObjectAsID.kt
│           │           ├── Engine.kt
│           │           ├── Environment.kt
│           │           ├── Expression.kt
│           │           ├── ExternalTexture.kt
│           │           ├── File.kt
│           │           ├── FileDialog.kt
│           │           ├── FileSystemDock.kt
│           │           ├── Font.kt
│           │           ├── FuncRef.kt
│           │           ├── GDNative.kt
│           │           ├── GDNativeLibrary.kt
│           │           ├── GDScript.kt
│           │           ├── GDScriptFunctionState.kt
│           │           ├── GIProbe.kt
│           │           ├── GIProbeData.kt
│           │           ├── Generic6DOFJoint.kt
│           │           ├── Geometry.kt
│           │           ├── GeometryInstance.kt
│           │           ├── GlobalConstants.kt
│           │           ├── Gradient.kt
│           │           ├── GradientTexture.kt
│           │           ├── GraphEdit.kt
│           │           ├── GraphNode.kt
│           │           ├── GridContainer.kt
│           │           ├── GridMap.kt
│           │           ├── GrooveJoint2D.kt
│           │           ├── HBoxContainer.kt
│           │           ├── HScrollBar.kt
│           │           ├── HSeparator.kt
│           │           ├── HSlider.kt
│           │           ├── HSplitContainer.kt
│           │           ├── HTTPClient.kt
│           │           ├── HTTPRequest.kt
│           │           ├── HashingContext.kt
│           │           ├── HeightMapShape.kt
│           │           ├── HingeJoint.kt
│           │           ├── IP.kt
│           │           ├── Image.kt
│           │           ├── ImageTexture.kt
│           │           ├── ImmediateGeometry.kt
│           │           ├── Input.kt
│           │           ├── InputEvent.kt
│           │           ├── InputEventAction.kt
│           │           ├── InputEventGesture.kt
│           │           ├── InputEventJoypadButton.kt
│           │           ├── InputEventJoypadMotion.kt
│           │           ├── InputEventKey.kt
│           │           ├── InputEventMIDI.kt
│           │           ├── InputEventMagnifyGesture.kt
│           │           ├── InputEventMouse.kt
│           │           ├── InputEventMouseButton.kt
│           │           ├── InputEventMouseMotion.kt
│           │           ├── InputEventPanGesture.kt
│           │           ├── InputEventScreenDrag.kt
│           │           ├── InputEventScreenTouch.kt
│           │           ├── InputEventWithModifiers.kt
│           │           ├── InputMap.kt
│           │           ├── InstancePlaceholder.kt
│           │           ├── InterpolatedCamera.kt
│           │           ├── ItemList.kt
│           │           ├── JNISingleton.kt
│           │           ├── JSON.kt
│           │           ├── JSONParseResult.kt
│           │           ├── JSONRPC.kt
│           │           ├── JavaClass.kt
│           │           ├── JavaClassWrapper.kt
│           │           ├── JavaScript.kt
│           │           ├── Joint.kt
│           │           ├── Joint2D.kt
│           │           ├── KinematicBody.kt
│           │           ├── KinematicBody2D.kt
│           │           ├── KinematicCollision.kt
│           │           ├── KinematicCollision2D.kt
│           │           ├── Label.kt
│           │           ├── LargeTexture.kt
│           │           ├── Light.kt
│           │           ├── Light2D.kt
│           │           ├── LightOccluder2D.kt
│           │           ├── Line2D.kt
│           │           ├── LineEdit.kt
│           │           ├── LineShape2D.kt
│           │           ├── LinkButton.kt
│           │           ├── Listener.kt
│           │           ├── MainLoop.kt
│           │           ├── MarginContainer.kt
│           │           ├── Marshalls.kt
│           │           ├── Material.kt
│           │           ├── MenuButton.kt
│           │           ├── Mesh.kt
│           │           ├── MeshDataTool.kt
│           │           ├── MeshInstance.kt
│           │           ├── MeshInstance2D.kt
│           │           ├── MeshLibrary.kt
│           │           ├── MeshTexture.kt
│           │           ├── MobileVRInterface.kt
│           │           ├── MultiMesh.kt
│           │           ├── MultiMeshInstance.kt
│           │           ├── MultiMeshInstance2D.kt
│           │           ├── MultiplayerAPI.kt
│           │           ├── MultiplayerPeerGDNative.kt
│           │           ├── Mutex.kt
│           │           ├── NativeScript.kt
│           │           ├── Navigation.kt
│           │           ├── Navigation2D.kt
│           │           ├── NavigationMesh.kt
│           │           ├── NavigationMeshInstance.kt
│           │           ├── NavigationPolygon.kt
│           │           ├── NavigationPolygonInstance.kt
│           │           ├── NetworkedMultiplayerENet.kt
│           │           ├── NetworkedMultiplayerPeer.kt
│           │           ├── NinePatchRect.kt
│           │           ├── Node.kt
│           │           ├── Node2D.kt
│           │           ├── NoiseTexture.kt
│           │           ├── OS.kt
│           │           ├── Object.kt
│           │           ├── OccluderPolygon2D.kt
│           │           ├── OmniLight.kt
│           │           ├── OpenSimplexNoise.kt
│           │           ├── OptionButton.kt
│           │           ├── PCKPacker.kt
│           │           ├── PHashTranslation.kt
│           │           ├── PackedDataContainer.kt
│           │           ├── PackedDataContainerRef.kt
│           │           ├── PackedScene.kt
│           │           ├── PacketPeer.kt
│           │           ├── PacketPeerDTLS.kt
│           │           ├── PacketPeerGDNative.kt
│           │           ├── PacketPeerStream.kt
│           │           ├── PacketPeerUDP.kt
│           │           ├── Panel.kt
│           │           ├── PanelContainer.kt
│           │           ├── PanoramaSky.kt
│           │           ├── ParallaxBackground.kt
│           │           ├── ParallaxLayer.kt
│           │           ├── Particles.kt
│           │           ├── Particles2D.kt
│           │           ├── ParticlesMaterial.kt
│           │           ├── Path.kt
│           │           ├── Path2D.kt
│           │           ├── PathFollow.kt
│           │           ├── PathFollow2D.kt
│           │           ├── Performance.kt
│           │           ├── PhysicalBone.kt
│           │           ├── Physics2DDirectBodyState.kt
│           │           ├── Physics2DDirectBodyStateSW.kt
│           │           ├── Physics2DDirectSpaceState.kt
│           │           ├── Physics2DServer.kt
│           │           ├── Physics2DShapeQueryParameters.kt
│           │           ├── Physics2DShapeQueryResult.kt
│           │           ├── Physics2DTestMotionResult.kt
│           │           ├── PhysicsBody.kt
│           │           ├── PhysicsBody2D.kt
│           │           ├── PhysicsDirectBodyState.kt
│           │           ├── PhysicsDirectSpaceState.kt
│           │           ├── PhysicsMaterial.kt
│           │           ├── PhysicsServer.kt
│           │           ├── PhysicsShapeQueryParameters.kt
│           │           ├── PhysicsShapeQueryResult.kt
│           │           ├── PinJoint.kt
│           │           ├── PinJoint2D.kt
│           │           ├── PlaneMesh.kt
│           │           ├── PlaneShape.kt
│           │           ├── PluginScript.kt
│           │           ├── PointMesh.kt
│           │           ├── Polygon2D.kt
│           │           ├── PolygonPathFinder.kt
│           │           ├── Popup.kt
│           │           ├── PopupDialog.kt
│           │           ├── PopupMenu.kt
│           │           ├── PopupPanel.kt
│           │           ├── Position2D.kt
│           │           ├── Position3D.kt
│           │           ├── PrimitiveMesh.kt
│           │           ├── PrismMesh.kt
│           │           ├── ProceduralSky.kt
│           │           ├── ProgressBar.kt
│           │           ├── ProjectSettings.kt
│           │           ├── ProximityGroup.kt
│           │           ├── ProxyTexture.kt
│           │           ├── QuadMesh.kt
│           │           ├── RandomNumberGenerator.kt
│           │           ├── Range.kt
│           │           ├── RayCast.kt
│           │           ├── RayCast2D.kt
│           │           ├── RayShape.kt
│           │           ├── RayShape2D.kt
│           │           ├── RectangleShape2D.kt
│           │           ├── Reference.kt
│           │           ├── ReferenceRect.kt
│           │           ├── ReflectionProbe.kt
│           │           ├── RegEx.kt
│           │           ├── RegExMatch.kt
│           │           ├── RemoteTransform.kt
│           │           ├── RemoteTransform2D.kt
│           │           ├── Resource.kt
│           │           ├── ResourceFormatLoader.kt
│           │           ├── ResourceFormatSaver.kt
│           │           ├── ResourceImporter.kt
│           │           ├── ResourceInteractiveLoader.kt
│           │           ├── ResourceLoader.kt
│           │           ├── ResourcePreloader.kt
│           │           ├── ResourceSaver.kt
│           │           ├── RichTextEffect.kt
│           │           ├── RichTextLabel.kt
│           │           ├── RigidBody.kt
│           │           ├── RigidBody2D.kt
│           │           ├── RootMotionView.kt
│           │           ├── SceneState.kt
│           │           ├── SceneTree.kt
│           │           ├── SceneTreeTimer.kt
│           │           ├── Script.kt
│           │           ├── ScriptCreateDialog.kt
│           │           ├── ScriptEditor.kt
│           │           ├── ScrollBar.kt
│           │           ├── ScrollContainer.kt
│           │           ├── SegmentShape2D.kt
│           │           ├── Semaphore.kt
│           │           ├── Separator.kt
│           │           ├── Shader.kt
│           │           ├── ShaderMaterial.kt
│           │           ├── Shape.kt
│           │           ├── Shape2D.kt
│           │           ├── ShortCut.kt
│           │           ├── Skeleton.kt
│           │           ├── Skeleton2D.kt
│           │           ├── SkeletonIK.kt
│           │           ├── Skin.kt
│           │           ├── SkinReference.kt
│           │           ├── Sky.kt
│           │           ├── Slider.kt
│           │           ├── SliderJoint.kt
│           │           ├── SoftBody.kt
│           │           ├── Spatial.kt
│           │           ├── SpatialGizmo.kt
│           │           ├── SpatialMaterial.kt
│           │           ├── SpatialVelocityTracker.kt
│           │           ├── SphereMesh.kt
│           │           ├── SphereShape.kt
│           │           ├── SpinBox.kt
│           │           ├── SplitContainer.kt
│           │           ├── SpotLight.kt
│           │           ├── SpringArm.kt
│           │           ├── Sprite.kt
│           │           ├── Sprite3D.kt
│           │           ├── SpriteBase3D.kt
│           │           ├── SpriteFrames.kt
│           │           ├── StaticBody.kt
│           │           ├── StaticBody2D.kt
│           │           ├── StreamPeer.kt
│           │           ├── StreamPeerBuffer.kt
│           │           ├── StreamPeerGDNative.kt
│           │           ├── StreamPeerSSL.kt
│           │           ├── StreamPeerTCP.kt
│           │           ├── StreamTexture.kt
│           │           ├── StyleBox.kt
│           │           ├── StyleBoxEmpty.kt
│           │           ├── StyleBoxFlat.kt
│           │           ├── StyleBoxLine.kt
│           │           ├── StyleBoxTexture.kt
│           │           ├── SurfaceTool.kt
│           │           ├── TCP_Server.kt
│           │           ├── TabContainer.kt
│           │           ├── Tabs.kt
│           │           ├── TextEdit.kt
│           │           ├── TextFile.kt
│           │           ├── Texture.kt
│           │           ├── Texture3D.kt
│           │           ├── TextureArray.kt
│           │           ├── TextureButton.kt
│           │           ├── TextureLayered.kt
│           │           ├── TextureProgress.kt
│           │           ├── TextureRect.kt
│           │           ├── Theme.kt
│           │           ├── Thread.kt
│           │           ├── TileMap.kt
│           │           ├── TileSet.kt
│           │           ├── Timer.kt
│           │           ├── ToolButton.kt
│           │           ├── TouchScreenButton.kt
│           │           ├── Translation.kt
│           │           ├── TranslationServer.kt
│           │           ├── Tree.kt
│           │           ├── TreeItem.kt
│           │           ├── TriangleMesh.kt
│           │           ├── Tween.kt
│           │           ├── UDPServer.kt
│           │           ├── UPNP.kt
│           │           ├── UPNPDevice.kt
│           │           ├── UndoRedo.kt
│           │           ├── VBoxContainer.kt
│           │           ├── VScrollBar.kt
│           │           ├── VSeparator.kt
│           │           ├── VSlider.kt
│           │           ├── VSplitContainer.kt
│           │           ├── VehicleBody.kt
│           │           ├── VehicleWheel.kt
│           │           ├── VideoPlayer.kt
│           │           ├── VideoStream.kt
│           │           ├── VideoStreamGDNative.kt
│           │           ├── VideoStreamTheora.kt
│           │           ├── VideoStreamWebm.kt
│           │           ├── Viewport.kt
│           │           ├── ViewportContainer.kt
│           │           ├── ViewportTexture.kt
│           │           ├── VisibilityEnabler.kt
│           │           ├── VisibilityEnabler2D.kt
│           │           ├── VisibilityNotifier.kt
│           │           ├── VisibilityNotifier2D.kt
│           │           ├── VisualInstance.kt
│           │           ├── VisualScript.kt
│           │           ├── VisualScriptBasicTypeConstant.kt
│           │           ├── VisualScriptBuiltinFunc.kt
│           │           ├── VisualScriptClassConstant.kt
│           │           ├── VisualScriptComment.kt
│           │           ├── VisualScriptComposeArray.kt
│           │           ├── VisualScriptCondition.kt
│           │           ├── VisualScriptConstant.kt
│           │           ├── VisualScriptConstructor.kt
│           │           ├── VisualScriptCustomNode.kt
│           │           ├── VisualScriptDeconstruct.kt
│           │           ├── VisualScriptEditor.kt
│           │           ├── VisualScriptEmitSignal.kt
│           │           ├── VisualScriptEngineSingleton.kt
│           │           ├── VisualScriptExpression.kt
│           │           ├── VisualScriptFunction.kt
│           │           ├── VisualScriptFunctionCall.kt
│           │           ├── VisualScriptFunctionState.kt
│           │           ├── VisualScriptGlobalConstant.kt
│           │           ├── VisualScriptIndexGet.kt
│           │           ├── VisualScriptIndexSet.kt
│           │           ├── VisualScriptInputAction.kt
│           │           ├── VisualScriptIterator.kt
│           │           ├── VisualScriptLists.kt
│           │           ├── VisualScriptLocalVar.kt
│           │           ├── VisualScriptLocalVarSet.kt
│           │           ├── VisualScriptMathConstant.kt
│           │           ├── VisualScriptNode.kt
│           │           ├── VisualScriptOperator.kt
│           │           ├── VisualScriptPreload.kt
│           │           ├── VisualScriptPropertyGet.kt
│           │           ├── VisualScriptPropertySet.kt
│           │           ├── VisualScriptResourcePath.kt
│           │           ├── VisualScriptReturn.kt
│           │           ├── VisualScriptSceneNode.kt
│           │           ├── VisualScriptSceneTree.kt
│           │           ├── VisualScriptSelect.kt
│           │           ├── VisualScriptSelf.kt
│           │           ├── VisualScriptSequence.kt
│           │           ├── VisualScriptSubCall.kt
│           │           ├── VisualScriptSwitch.kt
│           │           ├── VisualScriptTypeCast.kt
│           │           ├── VisualScriptVariableGet.kt
│           │           ├── VisualScriptVariableSet.kt
│           │           ├── VisualScriptWhile.kt
│           │           ├── VisualScriptYield.kt
│           │           ├── VisualScriptYieldSignal.kt
│           │           ├── VisualServer.kt
│           │           ├── VisualShader.kt
│           │           ├── VisualShaderNode.kt
│           │           ├── VisualShaderNodeBooleanConstant.kt
│           │           ├── VisualShaderNodeBooleanUniform.kt
│           │           ├── VisualShaderNodeColorConstant.kt
│           │           ├── VisualShaderNodeColorFunc.kt
│           │           ├── VisualShaderNodeColorOp.kt
│           │           ├── VisualShaderNodeColorUniform.kt
│           │           ├── VisualShaderNodeCompare.kt
│           │           ├── VisualShaderNodeCubeMap.kt
│           │           ├── VisualShaderNodeCubeMapUniform.kt
│           │           ├── VisualShaderNodeCustom.kt
│           │           ├── VisualShaderNodeDeterminant.kt
│           │           ├── VisualShaderNodeDotProduct.kt
│           │           ├── VisualShaderNodeExpression.kt
│           │           ├── VisualShaderNodeFaceForward.kt
│           │           ├── VisualShaderNodeFresnel.kt
│           │           ├── VisualShaderNodeGlobalExpression.kt
│           │           ├── VisualShaderNodeGroupBase.kt
│           │           ├── VisualShaderNodeIf.kt
│           │           ├── VisualShaderNodeInput.kt
│           │           ├── VisualShaderNodeIs.kt
│           │           ├── VisualShaderNodeOuterProduct.kt
│           │           ├── VisualShaderNodeOutput.kt
│           │           ├── VisualShaderNodeScalarClamp.kt
│           │           ├── VisualShaderNodeScalarConstant.kt
│           │           ├── VisualShaderNodeScalarDerivativeFunc.kt
│           │           ├── VisualShaderNodeScalarFunc.kt
│           │           ├── VisualShaderNodeScalarInterp.kt
│           │           ├── VisualShaderNodeScalarOp.kt
│           │           ├── VisualShaderNodeScalarSmoothStep.kt
│           │           ├── VisualShaderNodeScalarSwitch.kt
│           │           ├── VisualShaderNodeScalarUniform.kt
│           │           ├── VisualShaderNodeSwitch.kt
│           │           ├── VisualShaderNodeTexture.kt
│           │           ├── VisualShaderNodeTextureUniform.kt
│           │           ├── VisualShaderNodeTextureUniformTriplanar.kt
│           │           ├── VisualShaderNodeTransformCompose.kt
│           │           ├── VisualShaderNodeTransformConstant.kt
│           │           ├── VisualShaderNodeTransformDecompose.kt
│           │           ├── VisualShaderNodeTransformFunc.kt
│           │           ├── VisualShaderNodeTransformMult.kt
│           │           ├── VisualShaderNodeTransformUniform.kt
│           │           ├── VisualShaderNodeTransformVecMult.kt
│           │           ├── VisualShaderNodeUniform.kt
│           │           ├── VisualShaderNodeVec3Constant.kt
│           │           ├── VisualShaderNodeVec3Uniform.kt
│           │           ├── VisualShaderNodeVectorClamp.kt
│           │           ├── VisualShaderNodeVectorCompose.kt
│           │           ├── VisualShaderNodeVectorDecompose.kt
│           │           ├── VisualShaderNodeVectorDerivativeFunc.kt
│           │           ├── VisualShaderNodeVectorDistance.kt
│           │           ├── VisualShaderNodeVectorFunc.kt
│           │           ├── VisualShaderNodeVectorInterp.kt
│           │           ├── VisualShaderNodeVectorLen.kt
│           │           ├── VisualShaderNodeVectorOp.kt
│           │           ├── VisualShaderNodeVectorRefract.kt
│           │           ├── VisualShaderNodeVectorScalarMix.kt
│           │           ├── VisualShaderNodeVectorScalarSmoothStep.kt
│           │           ├── VisualShaderNodeVectorScalarStep.kt
│           │           ├── VisualShaderNodeVectorSmoothStep.kt
│           │           ├── WeakRef.kt
│           │           ├── WebRTCDataChannel.kt
│           │           ├── WebRTCDataChannelGDNative.kt
│           │           ├── WebRTCMultiplayer.kt
│           │           ├── WebRTCPeerConnection.kt
│           │           ├── WebRTCPeerConnectionGDNative.kt
│           │           ├── WebSocketClient.kt
│           │           ├── WebSocketMultiplayerPeer.kt
│           │           ├── WebSocketPeer.kt
│           │           ├── WebSocketServer.kt
│           │           ├── WindowDialog.kt
│           │           ├── World.kt
│           │           ├── World2D.kt
│           │           ├── WorldEnvironment.kt
│           │           ├── X509Certificate.kt
│           │           ├── XMLParser.kt
│           │           ├── YSort.kt
│           │           ├── icalls/
│           │           │   └── __icalls.kt
│           │           └── registerEngineTypes.kt
│           ├── nativeInternal/
│           │   └── kotlin/
│           │       └── godot/
│           │           └── internal/
│           │               ├── KObject.kt
│           │               ├── type/
│           │               │   ├── CoreType.kt
│           │               │   ├── nullSafety.kt
│           │               │   └── typeSize.kt
│           │               └── utils/
│           │                   └── getFromGDNative.kt
│           ├── nativeInterop/
│           │   └── cinterop/
│           │       └── godot.def
│           └── nativePublic/
│               └── kotlin/
│                   └── godot/
│                       ├── annotation/
│                       │   ├── PropertyTypeHintAnnotation.kt
│                       │   └── RegisterAnnotation.kt
│                       ├── extensions.kt
│                       ├── global/
│                       │   ├── GD.kt
│                       │   ├── GDCore.kt
│                       │   ├── GDMath.kt
│                       │   ├── GDPrint.kt
│                       │   └── GDRandom.kt
│                       ├── helper/
│                       │   └── Vararg.kt
│                       └── registration/
│                           └── Range.kt
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── plugins/
│   └── godot-gradle-plugin/
│       ├── build.gradle.kts
│       └── src/
│           └── main/
│               ├── kotlin/
│               │   └── godot/
│               │       └── gradle/
│               │           ├── GenerateGdnlib.kt
│               │           ├── GodotExtension.kt
│               │           ├── GodotPlatform.kt
│               │           ├── GodotPlugin.kt
│               │           └── subplugin/
│               │               └── GodotSubPlugin.kt
│               └── resources/
│                   └── META-INF/
│                       └── services/
│                           └── org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin
├── samples/
│   ├── 3d-platformer/
│   │   ├── .import/
│   │   │   ├── cutout.png-8aacc6c936bf12e889c8e11f6c4eb91c.md5
│   │   │   ├── cutout.png-8aacc6c936bf12e889c8e11f6c4eb91c.stex
│   │   │   ├── icon.png-487276ed1e3a0c39cad0279d744ee560.md5
│   │   │   ├── icon.png-487276ed1e3a0c39cad0279d744ee560.stex
│   │   │   ├── osb_down.png-4a1ab934f787719766862b499528d054.md5
│   │   │   ├── osb_down.png-4a1ab934f787719766862b499528d054.stex
│   │   │   ├── osb_fire.png-e657a73546eb75918e9d9a3fea15cf70.md5
│   │   │   ├── osb_fire.png-e657a73546eb75918e9d9a3fea15cf70.stex
│   │   │   ├── osb_jump.png-dbbef3b47abbb562ce6c81a9701121c6.md5
│   │   │   ├── osb_jump.png-dbbef3b47abbb562ce6c81a9701121c6.stex
│   │   │   ├── osb_left.png-fc7230aeb0eec74933ed08f89b893288.md5
│   │   │   ├── osb_left.png-fc7230aeb0eec74933ed08f89b893288.stex
│   │   │   ├── osb_right.png-5cf5add2dbc1c8dde17173ac56f3a004.md5
│   │   │   ├── osb_right.png-5cf5add2dbc1c8dde17173ac56f3a004.stex
│   │   │   ├── osb_up.png-6a05b6a7bf0ede3756308a5cffdd2b9a.md5
│   │   │   ├── osb_up.png-6a05b6a7bf0ede3756308a5cffdd2b9a.stex
│   │   │   ├── panorama.png-e05131d3dca9fd5b03101f18fbe08995.md5
│   │   │   ├── panorama.png-e05131d3dca9fd5b03101f18fbe08995.stex
│   │   │   ├── robot_walk.wav-4313e7d5f563e62e3923080b14a79c15.md5
│   │   │   ├── robot_walk.wav-4313e7d5f563e62e3923080b14a79c15.sample
│   │   │   ├── shine.png-a8253c1d2dc8acbf187823f695c13207.etc2.stex
│   │   │   ├── shine.png-a8253c1d2dc8acbf187823f695c13207.md5
│   │   │   ├── shine.png-a8253c1d2dc8acbf187823f695c13207.s3tc.stex
│   │   │   ├── sound_coin.wav-b4defacd1a1eab95585c7b5095506878.md5
│   │   │   ├── sound_coin.wav-b4defacd1a1eab95585c7b5095506878.sample
│   │   │   ├── sound_explode.wav-23e94be75a4346bffb517c7e07035977.md5
│   │   │   ├── sound_explode.wav-23e94be75a4346bffb517c7e07035977.sample
│   │   │   ├── sound_hit.wav-d8455980ada2d4a9a73508948d7317cc.md5
│   │   │   ├── sound_hit.wav-d8455980ada2d4a9a73508948d7317cc.sample
│   │   │   ├── sound_jump.wav-4966d1f327e26a176b56ab335c03b5e1.md5
│   │   │   ├── sound_jump.wav-4966d1f327e26a176b56ab335c03b5e1.sample
│   │   │   ├── sound_shoot.wav-f0f26619cba21d411b53ad23b8788116.md5
│   │   │   ├── sound_shoot.wav-f0f26619cba21d411b53ad23b8788116.sample
│   │   │   ├── texture.png-77dc6ecaf884a35cd9dbaf886cacc46d.md5
│   │   │   ├── texture.png-77dc6ecaf884a35cd9dbaf886cacc46d.stex
│   │   │   ├── texturemr.png-0568a8b09834741143da53ce460e36f1.etc2.stex
│   │   │   ├── texturemr.png-0568a8b09834741143da53ce460e36f1.md5
│   │   │   └── texturemr.png-0568a8b09834741143da53ce460e36f1.s3tc.stex
│   │   ├── build.gradle.kts
│   │   ├── bullet.gd
│   │   ├── bullet.scn
│   │   ├── coin.gd
│   │   ├── coin.scn
│   │   ├── cutout.png.import
│   │   ├── default_bus_layout.tres
│   │   ├── enemy.gd
│   │   ├── enemy.scn
│   │   ├── export_presets.cfg
│   │   ├── follow_camera.gd
│   │   ├── gradle/
│   │   │   └── wrapper/
│   │   │       ├── gradle-wrapper.jar
│   │   │       └── gradle-wrapper.properties
│   │   ├── gradle.properties
│   │   ├── gradlew
│   │   ├── gradlew.bat
│   │   ├── icon.png.import
│   │   ├── osb_down.png.import
│   │   ├── osb_fire.png.import
│   │   ├── osb_jump.png.import
│   │   ├── osb_left.png.import
│   │   ├── osb_right.png.import
│   │   ├── osb_up.png.import
│   │   ├── panorama.png.import
│   │   ├── platformer3d.gdnlib
│   │   ├── player.gd
│   │   ├── player.scn
│   │   ├── project.godot
│   │   ├── robot_walk.wav.import
│   │   ├── robotrigged.scn
│   │   ├── sb.cube
│   │   ├── settings.gradle.kts
│   │   ├── shine.png.import
│   │   ├── sound_coin.wav.import
│   │   ├── sound_explode.wav.import
│   │   ├── sound_hit.wav.import
│   │   ├── sound_jump.wav.import
│   │   ├── sound_shoot.wav.import
│   │   ├── src/
│   │   │   ├── gdns/
│   │   │   │   └── kotlin/
│   │   │   │       ├── Bullet.gdns
│   │   │   │       ├── Coin.gdns
│   │   │   │       ├── Enemy.gdns
│   │   │   │       ├── FollowCamera.gdns
│   │   │   │       └── Player.gdns
│   │   │   └── godotMain/
│   │   │       └── kotlin/
│   │   │           ├── Bullet.kt
│   │   │           ├── Coin.kt
│   │   │           ├── Enemy.kt
│   │   │           ├── FollowCamera.kt
│   │   │           └── Player.kt
│   │   ├── stage.scn
│   │   ├── texture.png.import
│   │   ├── texturemr.png.import
│   │   ├── tiles.res
│   │   └── tiles.scn
│   ├── README.md
│   └── mini-games/
│       ├── Node2D.tscn
│       ├── Sprite.gd
│       ├── build.gradle.kts
│       ├── default_env.tres
│       ├── gradle/
│       │   └── wrapper/
│       │       ├── gradle-wrapper.jar
│       │       └── gradle-wrapper.properties
│       ├── gradle.properties
│       ├── gradlew
│       ├── gradlew.bat
│       ├── icon.png.import
│       ├── mini-games.gdnlib
│       ├── project.godot
│       ├── settings.gradle.kts
│       └── src/
│           ├── gdns/
│           │   └── kotlin/
│           │       └── example/
│           │           ├── TestingClass.gdns
│           │           └── TextureSample.gdns
│           └── godotMain/
│               └── kotlin/
│                   └── example/
│                       ├── TestEnum.kt
│                       ├── TestingClass.kt
│                       └── TextureSample.kt
├── settings.gradle.kts
└── utils/
    ├── composite-build-support/
    │   ├── README.md
    │   └── build.gradle.kts
    └── godot-build-props/
        ├── build.gradle.kts
        └── src/
            └── main/
                ├── kotlin/
                │   └── godot/
                │       └── utils/
                │           └── GodotBuildProperties.kt
                └── resources/
                    └── build.properties
Condensed preview — 934 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,426K chars).
[
  {
    "path": ".editorconfig",
    "chars": 78,
    "preview": "[*.{kt, kts}]\nindent_size = 4\nindent_style = space\ninsert_final_newline = true"
  },
  {
    "path": ".gitattributes",
    "chars": 277,
    "preview": "#\n# https://help.github.com/articles/dealing-with-line-endings/\n#\n# These are explicitly windows files and should use cr"
  },
  {
    "path": ".github/CODEOWNERS",
    "chars": 548,
    "preview": "# fallback to everyone if there is no match\n* @CedNaru @chippmann @raniejade @piiertho\n\n# entry generator\nentry-generati"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 235,
    "preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Version:**\n\n**"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 636,
    "preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe th"
  },
  {
    "path": ".github/bin/check-repo-is-clean.sh",
    "chars": 171,
    "preview": "#!/usr/bin/env bash\n\nif [ -n \"$(git status --porcelain)\" ]; then\n  echo \"Generated code is stale, please commit them!\"\n "
  },
  {
    "path": ".github/workflows/CI.yaml",
    "chars": 5396,
    "preview": "name: CI\non:\n  push:\n    branches:\n      - master\n    tags:\n      - '*'\n\njobs:\n  deploy_core:\n    strategy:\n      matrix"
  },
  {
    "path": ".github/workflows/check-pr-annotation-processor.yaml",
    "chars": 766,
    "preview": "name: Check PR - godot-annotation-processor\r\non:\r\n  pull_request:\r\n    paths:\r\n      - 'plugins/godot-annotation-process"
  },
  {
    "path": ".github/workflows/check-pr-build-props.yaml",
    "chars": 653,
    "preview": "name: Check PR - godot-build-props\r\non:\r\n  pull_request:\r\n    paths:\r\n      - 'utils/godot-build-props/**'\r\n      - 'bui"
  },
  {
    "path": ".github/workflows/check-pr-codegen-uptodate.yaml",
    "chars": 555,
    "preview": "name: Check PR - codegen-uptodate\non: pull_request\n\njobs:\n  validate:\n    runs-on: ubuntu-latest\n    steps:\n      - uses"
  },
  {
    "path": ".github/workflows/check-pr-compiler-native-plugin.yaml",
    "chars": 910,
    "preview": "name: Check PR - godot-compiler-native-plugin\r\non:\r\n  pull_request:\r\n    paths:\r\n      - 'entry-generation/godot-compile"
  },
  {
    "path": ".github/workflows/check-pr-compiler-plugin-common.yaml",
    "chars": 708,
    "preview": "name: Check PR - godot-compiler-plugin-common\r\non:\r\n  pull_request:\r\n    paths:\r\n      - 'entry-generation/godot-compile"
  },
  {
    "path": ".github/workflows/check-pr-compiler-plugin.yaml",
    "chars": 882,
    "preview": "name: Check PR - godot-compiler-plugin\r\non:\r\n  pull_request:\r\n    paths:\r\n      - 'entry-generation/godot-compiler-plugi"
  },
  {
    "path": ".github/workflows/check-pr-core.yaml",
    "chars": 959,
    "preview": "name: Check PR - godot-library\r\non:\r\n  pull_request:\r\n    paths:\r\n      - 'godot-kotlin/**'\r\n      - 'build.gradle.kts'\r"
  },
  {
    "path": ".github/workflows/check-pr-entry-generator.yaml",
    "chars": 680,
    "preview": "name: Check PR - godot-entry-generator\r\non:\r\n  pull_request:\r\n    paths:\r\n      - 'entry-generation/godot-entry-generato"
  },
  {
    "path": ".github/workflows/check-pr-gradle-plugin.yaml",
    "chars": 732,
    "preview": "name: Check PR - godot-gradle-plugin\r\non:\r\n  pull_request:\r\n    paths:\r\n      - 'plugins/godot-gradle-plugin/**'\r\n      "
  },
  {
    "path": ".github/workflows/check-pr-samples-3d-platformer.yaml",
    "chars": 1677,
    "preview": "name: Check PR - samples-3d-platformer\non:\n  pull_request:\n    paths:\n      - 'entry-generation/godot-compiler-native-pl"
  },
  {
    "path": ".github/workflows/check-pr-samples-mini-games.yaml",
    "chars": 1667,
    "preview": "name: Check PR - samples-mini-games\non:\n  pull_request:\n    paths:\n      - 'entry-generation/godot-compiler-native-plugi"
  },
  {
    "path": ".gitignore",
    "chars": 201,
    "preview": "# Ignore Gradle project-specific cache directory\n.gradle\n\n# Ignore Gradle build output directory\nbuild\n\n# IntelliJ IDEA\n"
  },
  {
    "path": ".gitmodules",
    "chars": 133,
    "preview": "[submodule \"godot-kotlin/godot-headers\"]\n\tpath = godot-kotlin/godot-headers\n\turl = https://github.com/GodotNativeTools/g"
  },
  {
    "path": ".readthedocs.yml",
    "chars": 388,
    "preview": "# .readthedocs.yml\n# Read the Docs configuration file\n# See https://docs.readthedocs.io/en/stable/config-file/v2.html fo"
  },
  {
    "path": "LICENSE",
    "chars": 1098,
    "preview": "MIT License\n\nCopyright (c) 2020 godot-kotlin Maintainers and Contributors\n\nPermission is hereby granted, free of charge,"
  },
  {
    "path": "README.md",
    "chars": 4110,
    "preview": "![Kotlin GDNative Logo](docs/src/doc/assets/img/logo.png)\n\n# Kotlin/Native binding for the Godot Game Engine\n\n## Overvie"
  },
  {
    "path": "build.gradle.kts",
    "chars": 852,
    "preview": "plugins {\n    id(\"org.ajoberstar.grgit\") version \"4.0.2\"\n}\n\nval currentCommit = grgit.head()\n// check if the current com"
  },
  {
    "path": "buildSrc/build.gradle.kts",
    "chars": 454,
    "preview": "plugins {\n    `kotlin-dsl`\n}\n\nrepositories {\n    jcenter()\n    mavenCentral()\n    gradlePluginPortal()\n}\n\ndependencies {"
  },
  {
    "path": "buildSrc/src/main/kotlin/BintrayPublish.kt",
    "chars": 4493,
    "preview": "import com.jfrog.bintray.gradle.BintrayExtension\nimport org.gradle.api.Plugin\nimport org.gradle.api.Project\nimport org.g"
  },
  {
    "path": "buildSrc/src/main/kotlin/DependenciesVersions.kt",
    "chars": 225,
    "preview": "object DependenciesVersions {\n    const val mpaptVersion: String = \"0.8.5\"\n    const val shadowJarPluginVersion: String "
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/Argument.kt",
    "chars": 1895,
    "preview": "package godot.codegen\n\nimport com.fasterxml.jackson.annotation.JsonCreator\nimport com.fasterxml.jackson.annotation.JsonI"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/Class.kt",
    "chars": 12627,
    "preview": "package godot.codegen\n\nimport com.fasterxml.jackson.annotation.JsonCreator\nimport com.fasterxml.jackson.annotation.JsonI"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/Enum.kt",
    "chars": 1602,
    "preview": "package godot.codegen\n\nimport com.fasterxml.jackson.annotation.JsonCreator\nimport com.fasterxml.jackson.annotation.JsonI"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/Graph.kt",
    "chars": 2811,
    "preview": "package godot.codegen\n\nclass Graph<T>(elements: List<T>, sortFun: (T, T) -> Boolean) {\n    val nodes = mutableListOf<Nod"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/ICall.kt",
    "chars": 9180,
    "preview": "package godot.codegen\n\nimport com.squareup.kotlinpoet.*\nimport com.squareup.kotlinpoet.ParameterizedTypeName.Companion.p"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/Method.kt",
    "chars": 5648,
    "preview": "package godot.codegen\n\nimport com.fasterxml.jackson.annotation.JsonCreator\nimport com.fasterxml.jackson.annotation.JsonI"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/Property.kt",
    "chars": 5264,
    "preview": "package godot.codegen\n\nimport com.fasterxml.jackson.annotation.JsonCreator\nimport com.fasterxml.jackson.annotation.JsonI"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/Signal.kt",
    "chars": 1838,
    "preview": "package godot.codegen\n\nimport com.fasterxml.jackson.annotation.JsonCreator\nimport com.fasterxml.jackson.annotation.JsonI"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/SignalArgument.kt",
    "chars": 507,
    "preview": "package godot.codegen\n\nimport com.fasterxml.jackson.annotation.JsonCreator\nimport com.fasterxml.jackson.annotation.JsonI"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/TypeCast.kt",
    "chars": 4289,
    "preview": "package godot.codegen\n\nprivate val coreTypes = listOf(\n    \"VariantArray\",\n    \"Basis\",\n    \"Color\",\n    \"Dictionary\",\n "
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/codegen/generationEntry.kt",
    "chars": 3548,
    "preview": "package godot.codegen\n\nimport com.fasterxml.jackson.core.type.TypeReference\nimport com.fasterxml.jackson.databind.Object"
  },
  {
    "path": "buildSrc/src/main/kotlin/godot/tasks/GenerateApiTask.kt",
    "chars": 630,
    "preview": "package godot.tasks\n\nimport org.gradle.api.DefaultTask\nimport org.gradle.api.tasks.InputFile\nimport org.gradle.api.tasks"
  },
  {
    "path": "buildSrc/src/main/kotlin/os.kt",
    "chars": 372,
    "preview": "import org.gradle.internal.os.OperatingSystem\n\nenum class OS {\n    LINUX,\n    MACOS,\n    WINDOWS\n}\n\nval currentOS by laz"
  },
  {
    "path": "design-docs/ABOUT.md",
    "chars": 273,
    "preview": "This folder contains decisions we made and why we made them.\nIt exists for us to remember why we made a certain decision"
  },
  {
    "path": "design-docs/dictionary.md",
    "chars": 7386,
    "preview": "This is an example of how pages inside this category might look like:\n\n---\n\n## Criteria\n\nThe next section list down seve"
  },
  {
    "path": "docs/.gitignore",
    "chars": 9,
    "preview": "site/\np3/"
  },
  {
    "path": "docs/SUMMARY.md",
    "chars": 479,
    "preview": "* [Overview](src/doc/index.md)\n* [API differences](src/doc/api-differences.md)\n* [Supported platforms](src/doc/supported"
  },
  {
    "path": "docs/build.sh",
    "chars": 284,
    "preview": "#! /usr/bin/env bash\nset -e\nBASEDIR=$(dirname \"$0\")\nVIRTUALENV_DIR=\"$BASEDIR/p3\"\n\nif [[ ! -d \"$VIRTUALENV_DIR\" ]]; then\n"
  },
  {
    "path": "docs/mkdocs.yml",
    "chars": 877,
    "preview": "site_name: Kotlin Native binding for Godot\ndocs_dir: src/doc\n\nrepo_name: 'utopia-rise/godot-kotlin'\nrepo_url: 'https://g"
  },
  {
    "path": "docs/requirements.txt",
    "chars": 37,
    "preview": "mkdocs-material==4.6.0\nmkdocs==1.0.4\n"
  },
  {
    "path": "docs/run.sh",
    "chars": 329,
    "preview": "#! /usr/bin/env bash\nset -e\nBASEDIR=$(dirname \"$0\")\nVIRTUALENV_DIR=\"$BASEDIR/p3\"\n\nif [[ ! -d \"$VIRTUALENV_DIR\" ]]; then\n"
  },
  {
    "path": "docs/src/doc/api-differences.md",
    "chars": 2953,
    "preview": "## Instance types and singletons\nCreating a new instance of a Godot type can be done like any Kotlin types.\n\n```kotlin\nv"
  },
  {
    "path": "docs/src/doc/contribution.md",
    "chars": 2349,
    "preview": "\nWe encourage you to contribute to the project if you want. Even if you don't have any idea how the binding works or if "
  },
  {
    "path": "docs/src/doc/index.md",
    "chars": 2685,
    "preview": "[![GitHub](https://img.shields.io/github/license/utopia-rise/godot-kotlin?style=flat-square)](LICENSE)\n[![GitHub Workflo"
  },
  {
    "path": "docs/src/doc/setup/gradle.md",
    "chars": 7316,
    "preview": "This binding uses [Gradle](https://gradle.org) as its build tool and you will need version 6.0 or higher installed. The "
  },
  {
    "path": "docs/src/doc/setup/ide.md",
    "chars": 990,
    "preview": "You will need either [IntelliJ IDEA](https://jetbrains.com/idea) (Ultimate is preferred but the Community edition works "
  },
  {
    "path": "docs/src/doc/supported-platforms.md",
    "chars": 238,
    "preview": "While Kotlin Native and Godot supports a wide range of platforms, this binding for the moment only supports the followin"
  },
  {
    "path": "docs/src/doc/user-guide/classes.md",
    "chars": 1972,
    "preview": "To expose a class written in Kotlin it needs to extend `godot.Object` (or any type that extends it) and annotate it with"
  },
  {
    "path": "docs/src/doc/user-guide/methods.md",
    "chars": 1522,
    "preview": "Any Kotlin function can be registered as long as its parameters and return type can be converted to a \n`Variant`, additi"
  },
  {
    "path": "docs/src/doc/user-guide/properties.md",
    "chars": 6373,
    "preview": "Any property of a registered class can be registered as long as it meets all of the following requirements:  \n \n - Defin"
  },
  {
    "path": "docs/src/doc/user-guide/signals.md",
    "chars": 1572,
    "preview": "Use the delegate `signal` to create a signal and annotate it with `@RegisterSignal`. Note that the name of \nthe signal m"
  },
  {
    "path": "entry-generation/godot-annotation-processor/build.gradle.kts",
    "chars": 1059,
    "preview": "plugins {\n    kotlin(\"jvm\")\n    `maven-publish`\n}\n\ndependencies {\n    implementation(project(\":godot-entry-generator\"))\n"
  },
  {
    "path": "entry-generation/godot-annotation-processor/src/main/kotlin/godot/annotation/processor/GodotAnnotationProcessor.kt",
    "chars": 4766,
    "preview": "package godot.annotation.processor\n\nimport de.jensklingenberg.mpapt.model.AbstractProcessor\nimport de.jensklingenberg.mp"
  },
  {
    "path": "entry-generation/godot-compiler-native-plugin/build.gradle.kts",
    "chars": 2277,
    "preview": "import com.github.jengelman.gradle.plugins.shadow.ShadowExtension\nimport com.github.jengelman.gradle.plugins.shadow.task"
  },
  {
    "path": "entry-generation/godot-compiler-native-plugin/src/main/kotlin/godot/compiler/plugin/NativeComponentRegistrar.kt",
    "chars": 5228,
    "preview": "package godot.compiler.plugin\n\nimport com.intellij.mock.MockProject\nimport de.jensklingenberg.mpapt.common.MpAptProject\n"
  },
  {
    "path": "entry-generation/godot-compiler-native-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor",
    "chars": 73,
    "preview": "godot.compiler.plugin.NativeGodotKotlinCompilerPluginCommandLineProcessor"
  },
  {
    "path": "entry-generation/godot-compiler-native-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar",
    "chars": 46,
    "preview": "godot.compiler.plugin.NativeComponentRegistrar"
  },
  {
    "path": "entry-generation/godot-compiler-plugin/build.gradle.kts",
    "chars": 1116,
    "preview": "plugins {\n    kotlin(\"jvm\")\n    `maven-publish`\n}\n\ndependencies {\n    implementation(project(\":godot-annotation-processo"
  },
  {
    "path": "entry-generation/godot-compiler-plugin/src/main/kotlin/godot/compiler/plugin/CommonComponentRegistrar.kt",
    "chars": 5055,
    "preview": "package godot.compiler.plugin\n\nimport com.intellij.mock.MockProject\nimport de.jensklingenberg.mpapt.common.MpAptProject\n"
  },
  {
    "path": "entry-generation/godot-compiler-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor",
    "chars": 73,
    "preview": "godot.compiler.plugin.CommonGodotKotlinCompilerPluginCommandLineProcessor"
  },
  {
    "path": "entry-generation/godot-compiler-plugin/src/main/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar",
    "chars": 46,
    "preview": "godot.compiler.plugin.CommonComponentRegistrar"
  },
  {
    "path": "entry-generation/godot-compiler-plugin-common/build.gradle.kts",
    "chars": 916,
    "preview": "plugins {\n    kotlin(\"jvm\")\n    `maven-publish`\n}\n\ndependencies {\n    compileOnly(kotlin(\"compiler\"))\n}\n\ntasks {\n    val"
  },
  {
    "path": "entry-generation/godot-compiler-plugin-common/src/main/kotlin/godot/compiler/plugin/CompilerPluginConst.kt",
    "chars": 1657,
    "preview": "package godot.compiler.plugin\n\nimport org.jetbrains.kotlin.config.CompilerConfigurationKey\n\nobject CompilerPluginConst {"
  },
  {
    "path": "entry-generation/godot-entry-generator/build.gradle.kts",
    "chars": 1028,
    "preview": "plugins {\n    kotlin(\"jvm\")\n    `maven-publish`\n}\n\ndependencies {\n    implementation(kotlin(\"stdlib\"))\n    compileOnly(k"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/EntryGenerator.kt",
    "chars": 1399,
    "preview": "package godot.entrygenerator\n\nimport godot.entrygenerator.filebuilder.EntryFileBuilder\nimport godot.entrygenerator.gener"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/exceptions/WrongAnnotationUsageException.kt",
    "chars": 721,
    "preview": "package godot.entrygenerator.exceptions\n\nimport org.jetbrains.kotlin.descriptors.PropertyDescriptor\nimport org.jetbrains"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/AnnotationExt.kt",
    "chars": 1087,
    "preview": "package godot.entrygenerator.extension\n\nimport org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor\nimport "
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/ClassDescriptorExt.kt",
    "chars": 325,
    "preview": "package godot.entrygenerator.extension\n\nimport org.jetbrains.kotlin.descriptors.ClassDescriptor\nimport org.jetbrains.kot"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/KotlinTypeExt.kt",
    "chars": 2566,
    "preview": "package godot.entrygenerator.extension\n\nimport org.jetbrains.kotlin.js.descriptorUtils.getJetTypeFqName\nimport org.jetbr"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/PropertyDescriptorExt.kt",
    "chars": 3113,
    "preview": "package godot.entrygenerator.extension\n\nimport org.jetbrains.kotlin.descriptors.PropertyDescriptor\nimport org.jetbrains."
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/extension/StringExt.kt",
    "chars": 2608,
    "preview": "package godot.entrygenerator.extension\n\nfun String.isString() = this == \"kotlin.String\"\n\nfun String.isGodotPrimitive() ="
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/filebuilder/EntryFileBuilder.kt",
    "chars": 3955,
    "preview": "package godot.entrygenerator.filebuilder\n\nimport com.squareup.kotlinpoet.AnnotationSpec\nimport com.squareup.kotlinpoet.C"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/ClassRegistrationGenerator.kt",
    "chars": 2463,
    "preview": "package godot.entrygenerator.generator\n\nimport com.squareup.kotlinpoet.ClassName\nimport com.squareup.kotlinpoet.FunSpec\n"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/FunctionRegistrationGenerator.kt",
    "chars": 7547,
    "preview": "package godot.entrygenerator.generator\n\nimport com.squareup.kotlinpoet.ClassName\nimport com.squareup.kotlinpoet.FunSpec\n"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/GdnsGenerator.kt",
    "chars": 1727,
    "preview": "package godot.entrygenerator.generator\n\nimport org.jetbrains.kotlin.descriptors.ClassDescriptor\nimport org.jetbrains.kot"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/PropertyRegistrationGenerator.kt",
    "chars": 11398,
    "preview": "package godot.entrygenerator.generator\n\nimport com.squareup.kotlinpoet.ClassName\nimport com.squareup.kotlinpoet.FunSpec\n"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/SignalRegistrationGenerator.kt",
    "chars": 4685,
    "preview": "package godot.entrygenerator.generator\n\nimport com.squareup.kotlinpoet.ClassName\nimport com.squareup.kotlinpoet.FunSpec\n"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/ArrayRegistrationValuesHandler.kt",
    "chars": 3569,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport godot.entrygenerator.ex"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/CoreTypeRegistrationValuesHandler.kt",
    "chars": 1964,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport godot.entrygenerator.ex"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/DefaultValueHandlerProvider.kt",
    "chars": 3319,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport godot.entrygenerator.extension.isCompatibleList\nimport godot.ent"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/EnumFlagRegistrationValuesHandler.kt",
    "chars": 2442,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport godot.entrygenerator.ex"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/EnumRegistrationValuesHandler.kt",
    "chars": 728,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport org.jetbrains.kotlin.de"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/IntFlagRegistrationValuesHandler.kt",
    "chars": 1332,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport godot.entrygenerator.ex"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/MultiLineTextRegistrationValuesHandler.kt",
    "chars": 658,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport org.jetbrains.kotlin.de"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/PlaceholderTextRegistrationValuesHandler.kt",
    "chars": 662,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport org.jetbrains.kotlin.de"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/PrimitiveRegistrationValuesHandler.kt",
    "chars": 12154,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport godot.entrygenerator.ex"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/RegistrationValuesHandler.kt",
    "chars": 14565,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport com.squareup.kotlinpoet"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/generator/provider/ResourceRegistrationValuesHandler.kt",
    "chars": 1221,
    "preview": "package godot.entrygenerator.generator.provider\n\nimport com.squareup.kotlinpoet.ClassName\nimport org.jetbrains.kotlin.de"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/mapper/PropertyHintTypeMapper.kt",
    "chars": 18420,
    "preview": "package godot.entrygenerator.mapper\n\nimport com.squareup.kotlinpoet.ClassName\nimport godot.entrygenerator.extension.getA"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/mapper/RpcModeAnnotationMapper.kt",
    "chars": 1489,
    "preview": "package godot.entrygenerator.mapper\n\nimport com.squareup.kotlinpoet.ClassName\n\nobject RpcModeAnnotationMapper {\n    /**\n"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/mapper/TypeToVariantAsClassNameMapper.kt",
    "chars": 2090,
    "preview": "package godot.entrygenerator.mapper\n\nimport com.squareup.kotlinpoet.ClassName\nimport godot.entrygenerator.extension.isCo"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/model/Annotations.kt",
    "chars": 1112,
    "preview": "package godot.entrygenerator.model\n\nconst val REGISTER_CLASS_ANNOTATION = \"godot.annotation.RegisterClass\"\nconst val REG"
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/model/ClassWithMembers.kt",
    "chars": 491,
    "preview": "package godot.entrygenerator.model\n\nimport org.jetbrains.kotlin.descriptors.ClassDescriptor\nimport org.jetbrains.kotlin."
  },
  {
    "path": "entry-generation/godot-entry-generator/src/main/kotlin/godot/entrygenerator/transformer/TypeDeclarationsToClassWithMemberTransformer.kt",
    "chars": 1348,
    "preview": "package godot.entrygenerator.transformer\n\nimport godot.entrygenerator.model.ClassWithMembers\nimport org.jetbrains.kotlin"
  },
  {
    "path": "godot-kotlin/godot-library/build.gradle.kts",
    "chars": 3222,
    "preview": "import godot.tasks.GenerateApiTask\nimport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget\nimport com.jfrog.bin"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/ClassHandle.kt",
    "chars": 6477,
    "preview": "package godot.core\n\nimport godot.MultiplayerAPI.RPCMode\nimport godot.Object\nimport godot.gdnative.*\nimport godot.interna"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/ClassRegistry.kt",
    "chars": 559,
    "preview": "package godot.core\n\nimport godot.Object\nimport kotlinx.cinterop.COpaquePointer\n\nclass ClassRegistry(private val nativesc"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/Godot.kt",
    "chars": 4636,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.*\nimport godot.internal.type.nullSafe\nimport godot.registe"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/IndexedIterator.kt",
    "chars": 733,
    "preview": "package godot.core\n\ninternal class IndexedIterator<T>(\n    private val length: Int,\n    private val getter: (Int) -> T\n)"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/MethodBindCache.kt",
    "chars": 898,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_method_bind\nimport kotlinx.cinterop.CPointer\nimport kotlinx.cinterop.cst"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/TypeManager.kt",
    "chars": 3635,
    "preview": "package godot.core\n\nimport godot.ClassDB\nimport godot.Object\nimport godot.internal.type.nullSafe\nimport kotlinx.cinterop"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/Wrapper.kt",
    "chars": 711,
    "preview": "package godot.core\n\nimport godot.internal.type.nullSafe\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.S"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/bridge.kt",
    "chars": 2990,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_variant\nimport godot.internal.type.nullSafe\nimport k"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/caseConverterExt.kt",
    "chars": 163,
    "preview": "package godot.core\n\nfun String.camelToSnakeCase(): String {\n    return \"(?<=[a-zA-Z])[A-Z]\".toRegex().replace(this) {\n  "
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/classBuilderDsl.kt",
    "chars": 9524,
    "preview": "@file:Suppress(\"EXPERIMENTAL_API_USAGE\")\n\npackage godot.core\n\nimport godot.MultiplayerAPI.RPCMode\nimport godot.Object\nim"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/functions.kt",
    "chars": 8376,
    "preview": "package godot.core\n\nimport godot.Object\n\nabstract class Function<T : Object, R>(\n    val parameterCount: Int\n) {\n    abs"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/properties.kt",
    "chars": 2358,
    "preview": "package godot.core\n\nimport godot.Object\nimport kotlin.reflect.KMutableProperty1\n\nopen class MutablePropertyHandler<T : O"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/signalProviders.kt",
    "chars": 3379,
    "preview": "package godot.core\n\nimport godot.Object\nimport kotlin.reflect.KProperty\n\nclass SignalDelegate<T : Signal>(val factory: ("
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/signals.kt",
    "chars": 3896,
    "preview": "package godot.core\n\nimport godot.Object\n\nabstract class Signal(\n    val name: String\n) {\n    protected fun emitSignal(in"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/AABB.kt",
    "chars": 15027,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_aabb\nimport go"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Basis.kt",
    "chars": 27865,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_basis\nimport g"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Color.kt",
    "chars": 26892,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_color\nimport g"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Dictionary.kt",
    "chars": 14163,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_dictionary_layout\nimport godot.internal.type.*\nimpor"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/GdString.kt",
    "chars": 2066,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_string\nimport "
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/GodotArray.kt",
    "chars": 8579,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array_layout\nimport godot.internal.type.*\nimport kot"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/NodePath.kt",
    "chars": 4312,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_node_path_layo"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Plane.kt",
    "chars": 6905,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_plane\nimport g"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Quat.kt",
    "chars": 12232,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_quat\nimport go"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/RID.kt",
    "chars": 2275,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.Object\nimport godot.gdnative."
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Rect2.kt",
    "chars": 9501,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_rect2\nimport g"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Transform.kt",
    "chars": 12471,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_transform\nimpo"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Transform2D.kt",
    "chars": 11805,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_transform2d\nim"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Variant.kt",
    "chars": 27515,
    "preview": "package godot.core\n\n\nimport godot.Object\nimport godot.gdnative.godot_variant\nimport godot.gdnative.godot_variant_type\nim"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Vector2.kt",
    "chars": 13643,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_vector2\nimport"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/Vector3.kt",
    "chars": 15226,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_vector3\nimport"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/EnumArray.kt",
    "chars": 6370,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array\nimport godot.internal.type.nullSafe\nimport kot"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/ObjectArray.kt",
    "chars": 6034,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array\nimport godot.internal.type.nullSafe\nimport kot"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/VariantArray.kt",
    "chars": 19410,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array\nimport godot.internal.type.CoreType\nimport god"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/AABBArray.kt",
    "chars": 1461,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/BasisArray.kt",
    "chars": 1478,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/ColorArray.kt",
    "chars": 1478,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/CoreArray.kt",
    "chars": 5502,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array\nimport godot.internal.type.*\nimport kotlinx.ci"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/NodePathArray.kt",
    "chars": 1529,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/PlaneArray.kt",
    "chars": 1478,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/QuatArray.kt",
    "chars": 1381,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/RIDArray.kt",
    "chars": 1444,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/Rect2Array.kt",
    "chars": 1478,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/Transform2DArray.kt",
    "chars": 1580,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/TransformArray.kt",
    "chars": 1546,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/Vector2Array.kt",
    "chars": 1512,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/core/Vector3Array.kt",
    "chars": 1512,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_array\nimport kotlinx.cinterop.COpaquePointer\nimport kotlinx.cinterop.CVa"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/primitive/BoolVariantArray.kt",
    "chars": 5582,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array\nimport godot.internal.type.nullSafe\nimport kot"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/primitive/IntVariantArray.kt",
    "chars": 6120,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array\nimport godot.internal.type.NaturalT\nimport god"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/primitive/RealVariantArray.kt",
    "chars": 5852,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array\nimport godot.internal.type.RealT\nimport godot."
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/array/primitive/StringVariantArray.kt",
    "chars": 5771,
    "preview": "package godot.core\n\nimport godot.Object\nimport godot.gdnative.godot_array\nimport godot.internal.type.nullSafe\nimport kot"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/pool/PoolByteArray.kt",
    "chars": 5901,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_pool_byte_arra"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/pool/PoolColorArray.kt",
    "chars": 4881,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_pool_color_arr"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/pool/PoolIntArray.kt",
    "chars": 4759,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_pool_int_array"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/pool/PoolRealArray.kt",
    "chars": 4731,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_pool_real_arra"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/pool/PoolStringArray.kt",
    "chars": 5043,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_pool_string_ar"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/pool/PoolVector2Array.kt",
    "chars": 5148,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_pool_vector2_a"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/pool/PoolVector3Array.kt",
    "chars": 5148,
    "preview": "@file:Suppress(\"unused\", \"MemberVisibilityCanBePrivate\")\n\npackage godot.core\n\nimport godot.gdnative.godot_pool_vector3_a"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/string/File.kt",
    "chars": 1747,
    "preview": "package godot.core\n\nimport godot.internal.type.nullSafe\nimport kotlinx.cinterop.invoke\n\n/** If the string is a valid fil"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/string/Hash.kt",
    "chars": 1168,
    "preview": "package godot.core\n\nimport godot.internal.type.nullSafe\nimport kotlinx.cinterop.invoke\n\n/** Hashes the string and return"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/string/UnEscape.kt",
    "chars": 2682,
    "preview": "package godot.core\n\nimport godot.internal.type.nullSafe\nimport kotlinx.cinterop.invoke\n\n/** Returns a copy of the string"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/string/Util.kt",
    "chars": 1000,
    "preview": "package godot.core.type.string\n\nimport godot.core.GdString\nimport godot.core.Godot\nimport godot.core.asGDString\nimport g"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/type/string/Validation.kt",
    "chars": 1664,
    "preview": "package godot.core\n\nimport godot.internal.type.nullSafe\nimport kotlinx.cinterop.invoke\n\n/** Returns true if this string "
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/typealias.kt",
    "chars": 90,
    "preview": "package godot.core\n\nimport godot.gdnative.godot_error\n\ntypealias GodotError = godot_error\n"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeCore/kotlin/godot/core/variantTypeMapping.kt",
    "chars": 3297,
    "preview": "@file:Suppress(\"EXPERIMENTAL_API_USAGE\")\n\npackage godot.core\n\nimport godot.Object\nimport godot.internal.type.CoreType\nim"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/ARVRAnchor.kt",
    "chars": 2038,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/ARVRCamera.kt",
    "chars": 329,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/ARVRController.kt",
    "chars": 3301,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/ARVRInterface.kt",
    "chars": 4564,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/ARVRInterfaceGDNative.kt",
    "chars": 375,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/ARVROrigin.kt",
    "chars": 1049,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/ARVRPositionalTracker.kt",
    "chars": 3901,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/ARVRServer.kt",
    "chars": 5345,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AStar.kt",
    "chars": 5720,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AStar2D.kt",
    "chars": 5670,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AcceptDialog.kt",
    "chars": 3610,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimatedSprite.kt",
    "chars": 6603,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimatedSprite3D.kt",
    "chars": 3253,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimatedTexture.kt",
    "chars": 167904,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/Animation.kt",
    "chars": 17755,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNode.kt",
    "chars": 5729,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeAdd2.kt",
    "chars": 1085,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeAdd3.kt",
    "chars": 1085,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeAnimation.kt",
    "chars": 1126,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeBlend2.kt",
    "chars": 1105,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeBlend3.kt",
    "chars": 1105,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeBlendSpace1D.kt",
    "chars": 40825,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeBlendSpace2D.kt",
    "chars": 54650,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeBlendTree.kt",
    "chars": 4032,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeOneShot.kt",
    "chars": 5152,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeOutput.kt",
    "chars": 369,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeStateMachine.kt",
    "chars": 5630,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeStateMachinePlayback.kt",
    "chars": 1654,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeStateMachineTransition.kt",
    "chars": 5422,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeTimeScale.kt",
    "chars": 378,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeTimeSeek.kt",
    "chars": 375,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationNodeTransition.kt",
    "chars": 24934,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationPlayer.kt",
    "chars": 12855,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  },
  {
    "path": "godot-kotlin/godot-library/src/nativeGen/kotlin/godot/AnimationRootNode.kt",
    "chars": 357,
    "preview": "// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY! ALL CHANGES TO IT WILL BE OVERWRITTEN ON EACH BUILD\npackage godot\n\ni"
  }
]

// ... and 734 more files (download for full content)

About this extraction

This page contains the full source code of the utopia-rise/godot-kotlin GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 934 files (3.9 MB), approximately 1.1M tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!