Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Book - CommandQueue  (Read 1665 times)

0 Members and 1 Guest are viewing this topic.

Urefeu

  • Newbie
  • *
  • Posts: 4
    • View Profile
Book - CommandQueue
« 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 !

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Book - CommandQueue
« Reply #1 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Urefeu

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Book - CommandQueue
« Reply #2 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Book - CommandQueue
« Reply #3 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jamesL

  • Full Member
  • ***
  • Posts: 124
    • View Profile
Re: Book - CommandQueue
« Reply #4 on: July 30, 2015, 12:12:00 am »
it's on sale for $10 right now


 

anything