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

Rework Gd constructors, add default() to engine classes #486

Merged
merged 2 commits into from
Nov 19, 2023

Commits on Nov 19, 2023

  1. Rework Gd constructors, add default() to engine classes

    Changes:
    - Rename `new` -> `from_object`
    - Rename `new_default` -> `default`
    - Rename `with_base` -> `from_init_fn`
    - Extend `impl Default` from user types to engine types that have a new() constructor (i.e. ref-counted ones)
    - Rename `GodotInit` -> `GodotDefault` to reflect new meaning
    - Enable `Gd::default()` and `Gd::new_alloc()` constructors depending on memory strategy
    
    Old names remain deprecated where possible.
    
    Add extension methods `T::new_gd()` and `T::alloc_gd()` as shortcuts for creating Gd<T> instances
    Bromeon committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    025a98b View commit details
    Browse the repository at this point in the history
  2. Remove Gd::new_alloc() for now

    There is almost no use case for this, since this is covered by `UserT::alloc_gd()` and `Engine::new_alloc()`
    in a shorter form. If we need generic programming, we should design it as a whole.
    Bromeon committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    8281437 View commit details
    Browse the repository at this point in the history