JNGL
job.hpp
Go to the documentation of this file.
1 // Copyright 2012-2020 Jan Niklas Hasse <[email protected]>
2 // For conditions of distribution and use, see copyright notice in LICENSE.txt
4 #pragma once
5 
6 #include <memory>
7 
8 namespace jngl {
9 
14 class Job {
15 public:
20  virtual void step() = 0;
21 
26  virtual void draw() const = 0;
27 
29  Job() = default;
30 
32  Job(const Job&) = default;
33 
35  Job& operator=(const Job&) = default;
36 
38  Job(Job&&) = default;
39 
41  Job& operator=(Job&&) = default;
42 
44  virtual ~Job();
45 };
46 
49 
50 } // namespace jngl
jngl::Job::step
virtual void step()=0
Advance the game logic.
jngl::Job::operator=
Job & operator=(Job &&)=default
Move assignment.
std::shared_ptr
jngl::addJob
void addJob(std::shared_ptr< Job > job)
Add a new Job which will be always be stepped and drawn by App::mainLoop()
jngl::Job
Background job which stays part of the main loop independent of the active jngl::Work.
Definition: job.hpp:14
jngl::Job::~Job
virtual ~Job()
Does nothing.
jngl::Job::operator=
Job & operator=(const Job &)=default
Copy assignment.
jngl::Job::Job
Job(Job &&)=default
Move constructor.
jngl
JNGL's main namespace.
Definition: App.hpp:9
memory
jngl::Job::Job
Job()=default
Does nothing.
jngl::Job::Job
Job(const Job &)=default
Copy constructor.
jngl::Job::draw
virtual void draw() const =0
Draw the game state.