SFML community forums

General => General discussions => Topic started by: Mortal on July 31, 2015, 02:32:15 pm

Title: SFML Game Development - Chapter - 4
Post by: Mortal 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?
Title: Re: SFML Game Development - Chapter - 4
Post by: eXpl0it3r on July 31, 2015, 05:58:09 pm
Are you looking at the official code on GitHub (https://github.com/SFML/SFML-Game-Development-Book) or just the one downloaded from Packt/in the book?

I unfortunately couldn't figure out where the posted code is from exactly.
Title: Re: SFML Game Development - Chapter - 4
Post by: Mortal 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