35 virtual void draw()
const = 0;
98template <
class T,
class... Args>
114 getJob([](
Job& job) {
return dynamic_cast<T*
>(&job) !=
nullptr; }));
Background job which stays part of the main loop independent of the active jngl::Work.
virtual void draw() const =0
Draw the game state.
Job & operator=(Job &&)=default
Move assignment.
Job & operator=(const Job &)=default
Copy assignment.
virtual void step()=0
Advance the game logic.
virtual ~Job()
Does nothing.
Job()=default
Does nothing.
Job(const Job &)=default
Copy constructor.
Job(Job &&)=default
Move constructor.
std::shared_ptr< T > getJob()
Returns the first Job that is a T.
void removeJob(Job *)
Removes the passed Job after all Jobs have been stepped.
void addJob(std::shared_ptr< Job > job)
Add a new Job which will be always be stepped and drawn by App::mainLoop()