V-Gears 0
Free Final Fantasy VII engine.
Module.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <OIS/OIS.h>
19#include "Event.h"
20
25
30
35
40
45
50};
51
55class Module {
56
57 public:
58
62 virtual ~Module(){}
63
67 virtual void Input(const VGears::Event& event) = 0;
68
72 virtual void Update() = 0;
73
79 void SetState(const MODULE_STATE state){state_ = state;}
80
86 const MODULE_STATE GetState() const {return state_;}
87
88 private:
89
94};
MODULE_STATE
Possible states of a module.
Definition: Module.h:24
@ MODULE_FINISH
The module has finished running.
Definition: Module.h:39
@ MODULE_START
The module is starting.
Definition: Module.h:29
@ MODULE_RUN
The module is running.
Definition: Module.h:34
@ MODULE_STOP
The module is stopped.
Definition: Module.h:44
@ MODULE_PAUSE
The module is paused.
Definition: Module.h:49
A game module.
Definition: Module.h:55
virtual void Input(const VGears::Event &event)=0
Handles an input event.
virtual ~Module()
Destructor.
Definition: Module.h:62
virtual void Update()=0
Updates the module state.
MODULE_STATE state_
The current module state.
Definition: Module.h:93
void SetState(const MODULE_STATE state)
Sets the module state.
Definition: Module.h:79
const MODULE_STATE GetState() const
Retrieves the module state.
Definition: Module.h:86
An input event.
Definition: Event.h:84