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
Timers #196
Timers #196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really happy about this already, there are only some minor things to change.
As you already said in chat we are abusing a bit too much with the find
and we should find an alternative solution.
As first thing I would add the function is_active_timer
so you can use that function to check if a TimerHandle
is valid and active. Then I would implement that function as follow:
bool TimerDatabag::is_active_timer(TimerHandle p_handle) {
return timers.size() < p_handle ? timers[p_handle] < UINT64_MAX : false;
}
I forgot to mention that a better place for the and you should register the databag here: https://github.com/GodotECS/godex/blob/main/modules/godot/register_types.cpp#L79-L94 to make it available. |
The CI failed because the correct way to define the type def should be something like: namespace godex {
typedef uint64_t Timer; // μs (microseconds) until the timer fires
typedef uint32_t TimerHandle;
}; |
I've still got to use the is_active_timer , but its in. I'll use it when we finish defining what to do with the destroyed timers vector, to polish up the logic. |
53f8c2d
to
fabae9c
Compare
266aec6
to
d78aeb9
Compare
Sorry for the force push(es)! Compressed all history, was quite messy, and rebased (makes my end of development easier). |
Do force push on PR branches is totally fine |
30b397b
to
3802364
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice we are getting there :) there are only few small things to address.
However, I think we should also add the System
that updates now
in the DataBag
. We can talk about it in chat if you need help with that, or with the registration process.
db0bf33
to
b39b9f4
Compare
8c36350
to
edc905e
Compare
63b8004
to
f4b543a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!!
No description provided.