Tags: tishin/SwiftGodot
Tags
remove GodotObject protocol (migueldeicaza#525) It doesn't seem like the GodotObject protocol has any reason to exist. This patch removes it. - The protocol has no requirements. - There is exactly one directly conforming type: Object. All descendants of Object inherit the conformance, but any constraint requiring GodotObject conformance can be rewritten to instead require Object inheritance. - There are three functions with GodotObject constraints: - `VariantStorable.makeOrUnwrap` - `Variant.asObject` - `lookupObject` All test cases pass if I change these constraints to require Object inheritance instead of GodotObject conformance. Co-authored-by: Rob Mayoff <mayoff@dqd.com>
remove GodotObject protocol (migueldeicaza#525) It doesn't seem like the GodotObject protocol has any reason to exist. This patch removes it. - The protocol has no requirements. - There is exactly one directly conforming type: Object. All descendants of Object inherit the conformance, but any constraint requiring GodotObject conformance can be rewritten to instead require Object inheritance. - There are three functions with GodotObject constraints: - `VariantStorable.makeOrUnwrap` - `Variant.asObject` - `lookupObject` All test cases pass if I change these constraints to require Object inheritance instead of GodotObject conformance. Co-authored-by: Rob Mayoff <mayoff@dqd.com>
Drop the `value:` parameter name from the various PackedArray.* append methods. Do that, but still provide a deprecated entry point to prevent breaking code. In a few cases where we surfaced an API that did the append but with the underlying type, we keep the value: parameter in the API, but introduce a convenience `append(_:)` method of the right type, for example for PackedByteArray that would be: 'func append(_ value: UInt8)`
Export enum (migueldeicaza#476) Export enumeration support Any enumeration that is blessed with `CaseIterable` can be then exported to Godot by using `@Export(.enum)` on it, like this: ``` enum MyEnumeration: Int, CaseIterable { case first case second } ``` To export, use the `.enum` parameter to Export: ``` @godot class Demo: Node { @export(.enum) var myState: MyEnumeration } ``` One limitation of the current change is that this works by using `CaseIterable`, either by manually typing it, or using the `PickerNameProvider` macro.
PreviousNext