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

Author Topic: SFML Game Development - Chapter - 4  (Read 2364 times)

0 Members and 1 Guest are viewing this topic.

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
SFML Game Development - Chapter - 4
« on: July 31, 2015, 02:32:15 pm »
first i want thanks everybody who contributed in the book, however, i'm reading chapter 4, i found  in std::fonctional expression in Command class
std::function<void(SceneNode&, sf::Time)>       action;
and functor in AircraftMover class
void operator() (Aircraft& aircraft, sf::Time) const
{
        aircraft.accelerate(velocity);
}
take two arguments. the second argument is sf::Time type which is never computed throughout all classes. My question why is it there while it never be considered?
« Last Edit: July 31, 2015, 02:34:34 pm by MORTAL »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: SFML Game Development - Chapter - 4
« Reply #1 on: July 31, 2015, 05:58:09 pm »
Are you looking at the official code on GitHub or just the one downloaded from Packt/in the book?

I unfortunately couldn't figure out where the posted code is from exactly.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mortal

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: SFML Game Development - Chapter - 4
« Reply #2 on: July 31, 2015, 06:30:15 pm »
hello @eXpl0it3r
it is from github. i could not know why sf::Time argument there really it confuses me. i hope it is there just for later used in proceeding chapters. i haven't finished the book yet
« Last Edit: July 31, 2015, 06:53:38 pm by MORTAL »

 

anything