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>
25
26namespace neogfx::game
27{
28 class game_world : public game::system<>
29 {
30 public:
31 define_event(ApplyingPhysics, applying_physics, step_time)
33 public:
34 game_world(game::i_ecs& aEcs);
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);
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}
define_event(ApplyingPhysics, applying_physics, step_time) define_event(PhysicsApplied
void set_time_step(double aTimestep_s)
bool apply() override
const i_string & name() const override
bool universal_gravitation_enabled() const
step_time_interval step_time
Definition chrono.hpp:59
#define define_event(name, declName,...)
Definition event.hpp:200
static const neolib::uuid & id()
static const i_string & name()