SFML community forums

Help => General => Topic started by: Urefeu on July 26, 2015, 12:42:22 pm

Title: Book - CommandQueue
Post by: Urefeu on July 26, 2015, 12:42:22 pm
Hello !

I have a few questions about the CommandQueue class (related to Command and KeyBinding), classes extracted from the SFML book.

What is the utility of this class ? I thought it was in order to execute the actions in the right order (using the network), is that right ?

Otherwise, why do this instead of just using events (ie when we press space or the jump key, we call the jump method of the player) ?

Finally in KeyBinding we can see RealtimeActions. Is that actions which are repeated when the key isnt released, such as moving to the right when the key is pressed, on the contrary to an action like a jump or an attack which is called only once when the corresponding key is pressed ?

Thanks !
Title: Re: Book - CommandQueue
Post by: Nexus on July 26, 2015, 02:18:58 pm
Have you actually read the book? All your questions are answered to great detail ;)

As the name implies, the command queue simply queues commands for later distribution and execution. The book explains its meaning a bit more precisely, what is unclear? It has nothing to do with the network.
Title: Re: Book - CommandQueue
Post by: Urefeu on July 26, 2015, 02:39:42 pm
I actually don't have the book, I just analyzed the code on Github in order to have a better code architecture.

That is why I'm asking.
Title: AW: Book - CommandQueue
Post by: eXpl0it3r on July 26, 2015, 08:49:06 pm
Might as well buy the book then, instead of expecting people to paraphrase the book for you for free. ;)
Title: Re: Book - CommandQueue
Post by: jamesL on July 30, 2015, 12:12:00 am
it's on sale for $10 right now