Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: Sync GD with Core #71946

Merged
merged 1 commit into from
Jan 26, 2023
Merged

C#: Sync GD with Core #71946

merged 1 commit into from
Jan 26, 2023

Conversation

raulsntos
Copy link
Member

@raulsntos raulsntos commented Jan 24, 2023

  • Add overloads to print methods that take a single string.
    • I think using a single string parameter is the most common scenario (we use it like that a lot in the documentation) so avoiding the array allocation should be a big perf improvement.
  • Use StringBuilder to append the print parameters.
    • Should result in better performance, but I haven't benchmarked this.
  • Remove GD.PrintStack.
    • Users can call GD.Print(System.Environment.StackTrace) directly.
  • Remove GD.Str.
    • Users can use $ string interpolation.
  • Add exception to GD.Range when step is 0.
    • GDScript version prints an error in this case.
  • Add GD.VarToBytesWithObjects and GD.BytesToVarWithObjects.
  • Remove optional boolean parameter from GD.VarToBytes and GD.BytesToVar.
  • Move GD.InstanceFromId to Godot.Object.InstanceFromId.
    • This feels more natural since Godot.Object already contains similar methods (IsInstanceValid and IsInstanceIdValid).
  • Add Godot.Object.IsInstanceIdValid.
  • Update documentation.

- Add overloads to print methods that take a single `string`.
- Use `StringBuilder` to append print parameters.
- Remove `PrintStack` method.
- Add `ErrorString`.
- Remove `Str` method.
- Add exception to `Range` when step is 0.
- Add `VarToBytesWithObjects` and `BytesToVarWithObjects`.
- Remove optional boolean parameter from `VarToBytes` and `BytesToVar`.
- Move `InstanceFromId` to `Godot.Object`.
- Add `Godot.Object.IsInstanceIdValid`.
- Update documentation.
@akien-mga akien-mga merged commit 239145d into godotengine:master Jan 26, 2023
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants