JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
WorkFactory.hpp
Go to the documentation of this file.
1
// Copyright 2024 Jan Niklas Hasse <jhasse@bixense.com>
2
// For conditions of distribution and use, see copyright notice in LICENSE.txt
4
#pragma once
5
6
#include "
work.hpp
"
7
8
namespace
jngl
{
9
10
class
WorkFactory
:
public
jngl::Work
{
11
public
:
12
explicit
WorkFactory
(
std::function
<
std::shared_ptr<Work>
()>);
13
14
private
:
15
void
step()
override
;
16
void
draw()
const override
;
17
void
onLoad()
override
;
18
19
std::shared_ptr<Work>
work;
20
std::function<std::shared_ptr<Work>
()> factory;
21
};
22
23
}
// namespace jngl
jngl::WorkFactory
Definition:
WorkFactory.hpp:10
jngl::Work
Active state of the game, e.g. a menu or the game itself.
Definition:
work.hpp:13
std::function
jngl
JNGL's main namespace.
Definition:
Achievement.hpp:10
std::shared_ptr
work.hpp