aboutsummaryrefslogtreecommitdiffstats
path: root/yage/engine/engine.h
blob: dabe55966af0c1fecf1427dba055fbb842ccd7a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/** ---------------------------------------------------------------------------
 * @file: engine.h
 *
 * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
 * MIT License, see LICENSE file for more details.
 * ----------------------------------------------------------------------------
 */

#ifndef YAGE_CORE_ENGINE_H
#define YAGE_CORE_ENGINE_H

#include "system.h"

#include <vector>

namespace yage
{

/// Main engine class that contains a systems, the main loop and the update
/// function that updates all the systems.
class Engine
{
public:
    /// Main game loop of the engine.
    void mainLoop();

    /// Updates the systems.
    void update();

    /// Adds a system to the engine.
    void addSystem(System *system);

    /// Returns the instance of the engine, as there is only one instance of the
    /// engine.
    static Engine &instance();

private:
    /// Vector of all the systems in the engine.
    std::vector<System *> systems_;
};

} // namespace yage

#endif