You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should implement a ZST type that can be used as a field, like gdnative's Property<T>.
This type will not store any value itself, but delegate to the custom getter and setter.
Example:
#[derive(GodotClass)]structMyClass{#[var(get)]synthetic_string:Property<GString>,}#[godot_api]implMyClass{#[func]fnget_synthetic_string(&self) -> GString{// Derive on-the-fly from instance state.}}
I originally thought this might be interesting as a workaround for #[constant] which is limited to integers. However, properties make impractical constants as they need a pre-existing instance. Static functions are better suited.
The text was updated successfully, but these errors were encountered:
I would propose calling it Placeholder<Type> instead. Property is something concrete in godot, so it might be a bit confusing.
Should getter/setter be obligatory to implement? If not, it would take care of some new/quirky PropertyFlags that are not handled by godot-rust yet – right now such examples could be group and categories (see: #226 (comment)) (not as a "real" supported solution ofc, more like band-aid before we figure out the real thing)
We should implement a ZST type that can be used as a field, like gdnative's
Property<T>
.This type will not store any value itself, but delegate to the custom getter and setter.
Example:
I originally thought this might be interesting as a workaround for
#[constant]
which is limited to integers. However, properties make impractical constants as they need a pre-existing instance. Static functions are better suited.The text was updated successfully, but these errors were encountered: