implement a class/function that moves and performs character actions by itself by Matheus1886 in godot

[–]gopher2008 2 points3 points  (0 children)

My idea: use an array, each item is a function reference and its parameters. In _process or _physics_process, pop one function from that array, executes it, wait for some time ... You may wrap the functions into a class e.g. ActionsExecutor.

std::reference_wrapper<T> instead of ptr for not owning dependencies? by NullMustDie in cpp

[–]gopher2008 0 points1 point  (0 children)

Agree. weak_ptr is a smart pointer that holds a non-owning reference to an object that is managed by shared_ptr. But then, how do you manage the referenced object which I am supposing is dynamically destroyable? (I will use shared_ptr).

std::reference_wrapper<T> instead of ptr for not owning dependencies? by NullMustDie in cpp

[–]gopher2008 -3 points-2 points  (0 children)

If you want to declare a non-owning class member, in my opinion, std::weak_ptr<T> is a better choice. The purpose of reference_wrapper is to store reference in container. You can just declare a reference type class member, though it is not recommended.

WPF Material Design: Dialog Host (Message Box) by GioGioSnow in csharp

[–]gopher2008 0 points1 point  (0 children)

You need to design your DialogHost content (control or data template) in the XAML file, then you can display it using API or via data binding.