neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
game_world.hpp
Go to the documentation of this file.
1
// game_world.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2018, 2020 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
#pragma once
20
21
#include <
neogfx/neogfx.hpp
>
22
#include <
neolib/ecs/chrono.hpp
>
23
#include <
neogfx/core/event.hpp
>
24
#include <
neogfx/game/system.hpp
>
25
26
namespace
neogfx::game
27
{
28
class
game_world
:
public
game::system
<>
29
{
30
public
:
31
define_event
(ApplyingPhysics, applying_physics,
step_time
)
32
define_event
(PhysicsApplied,
physics_applied
,
step_time
)
33
public:
34
game_world
(game::
i_ecs
& aEcs);
35
~
game_world
();
36
public:
37
const
system_id
&
id
() const override;
38
const
i_string
&
name
() const override;
39
public:
40
bool
apply
() override;
41
public:
42
void
set_time_step
(
double
aTimestep_s);
43
bool
universal_gravitation_enabled
() const;
44
void
enable_universal_gravitation
();
45
void
disable_universal_gravitation
();
46
public:
47
struct
meta
48
{
49
static
const
neolib::uuid
&
id
()
50
{
51
static
const
neolib::uuid
sId = { 0x60495660, 0x7da9, 0x4016, 0x841, { 0x7f, 0x3a, 0xae, 0x7d, 0x1e, 0x53 } };
52
return
sId;
53
}
54
static
const
i_string
&
name
()
55
{
56
static
const
string
sName =
"Game"
;
57
return
sName;
58
}
59
};
60
private
:
61
bool
iUniversalGravitationEnabled;
62
};
63
}
neogfx::game::game_world
Definition
game_world.hpp:29
neogfx::game::game_world::define_event
define_event(ApplyingPhysics, applying_physics, step_time) define_event(PhysicsApplied
neogfx::game::game_world::set_time_step
void set_time_step(double aTimestep_s)
neogfx::game::game_world::physics_applied
physics_applied
Definition
game_world.hpp:32
neogfx::game::game_world::apply
bool apply() override
neogfx::game::game_world::name
const i_string & name() const override
neogfx::game::game_world::enable_universal_gravitation
void enable_universal_gravitation()
neogfx::game::game_world::disable_universal_gravitation
void disable_universal_gravitation()
neogfx::game::game_world::universal_gravitation_enabled
bool universal_gravitation_enabled() const
neolib::ecs::i_ecs
Definition
i_ecs.hpp:85
neolib::ecs::system
Definition
system.hpp:58
neolib::i_string
Definition
i_string.hpp:49
neogfx::game
Definition
aabb_octree.hpp:31
neolib::ecs::step_time
step_time_interval step_time
Definition
chrono.hpp:59
event.hpp
system.hpp
neogfx.hpp
chrono.hpp
define_event
#define define_event(name, declName,...)
Definition
event.hpp:200
neogfx::game::game_world::meta
Definition
game_world.hpp:48
neogfx::game::game_world::meta::id
static const neolib::uuid & id()
Definition
game_world.hpp:49
neogfx::game::game_world::meta::name
static const i_string & name()
Definition
game_world.hpp:54
neolib::uuid
Definition
uuid.hpp:51
include
neogfx
game
game_world.hpp
Generated by
1.9.8