V-Gears 0
Free Final Fantasy VII engine.
Manager.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#include "Event.h"
18
24class Manager{
25
26 public:
27
31 enum Module{
32
38 FIELD = 0,
39
45 BATTLE = 1,
46
52 WORLD = 2
53 };
54
58 Manager();
59
63 virtual ~Manager();
64
70 Module GetModule() const;
71
79 bool IsModule(const Module module) const;
80
86 bool IsFieldModule() const;
87
93 bool IsBattleModule() const;
94
100 bool IsWorldModule() const;
101
109 void SetModule(const Module module);
110
117 void SetFieldModule();
118
125 void SetBattleModule();
126
133 void SetWorldModule();
134
142 void SetPreviousModule();
143
149 virtual void Input(const VGears::Event& event) = 0;
150
156 void Update();
157
163 virtual void UpdateDebug() = 0;
164
168 virtual void OnResize() = 0;
169
177 void Clear();
178
188 void Clear(const Module module);
189
193 virtual void ClearField() = 0;
194
198 virtual void ClearBattle() = 0;
199
203 virtual void ClearWorld() = 0;
204
212 void ClearAll();
213
219 void ScriptSetPaused(const bool paused);
220
221 protected:
222
226 virtual void UpdateField() = 0;
227
231 virtual void UpdateBattle() = 0;
232
236 virtual void UpdateWorld() = 0;
237
243 void Update(Module module);
244
249
254
259
260};
A base manager.
Definition: Manager.h:24
void SetWorldModule()
Sets the current module to the world map mode.
Definition: Manager.cpp:55
Module prev_module_
The previous module.
Definition: Manager.h:253
bool paused_
Indicates if the game is paused.
Definition: Manager.h:258
bool IsBattleModule() const
Checks if the currently selected module is the battle module.
Definition: Manager.cpp:32
void Update()
Called every frame, performs an update on the things controlled by the manager.
Definition: Manager.cpp:72
Manager()
Constructor.
Definition: Manager.cpp:22
void ScriptSetPaused(const bool paused)
Handles game pausing.
Definition: Manager.cpp:115
void Clear()
Clears the manager.
Definition: Manager.cpp:93
virtual void OnResize()=0
Handles resizing events.
virtual ~Manager()
Destructor.
Definition: Manager.cpp:24
void ClearAll()
Clears the manager.
Definition: Manager.cpp:109
Module GetModule() const
Retrieves the currently selected module.
Definition: Manager.cpp:26
virtual void UpdateWorld()=0
Updates the world map entities in the manager.
virtual void ClearBattle()=0
Clear all battle information in the manager.
virtual void ClearField()=0
Clear all field information in the manager.
virtual void Input(const VGears::Event &event)=0
Handles an input event.
Module module_
The currently selected module.
Definition: Manager.h:248
virtual void UpdateBattle()=0
Updates the battle entities in the manager.
@ BATTLE
Battle module.
Definition: Manager.h:45
@ WORLD
World map module.
Definition: Manager.h:52
@ FIELD
Field module.
Definition: Manager.h:38
void SetModule(const Module module)
Sets the current module for the entity manager.
Definition: Manager.cpp:36
bool IsFieldModule() const
Checks if the currently selected module is the field module.
Definition: Manager.cpp:30
virtual void UpdateDebug()=0
Called every frame, performs an update on the things controlled by the manager.
virtual void UpdateField()=0
Updates the field entities in the manager.
void SetFieldModule()
Sets the current module to the field mode.
Definition: Manager.cpp:51
void SetBattleModule()
Sets the current module to the battle mode.
Definition: Manager.cpp:53
bool IsWorldModule() const
Checks if the currently selected module is the world module.
Definition: Manager.cpp:34
bool IsModule(const Module module) const
Checks the currently selected module.
Definition: Manager.cpp:28
virtual void ClearWorld()=0
Clear all world map information in the manager.
void SetPreviousModule()
Sets the module that was loaded before a battle.
Definition: Manager.cpp:57
A game module.
Definition: Module.h:55
An input event.
Definition: Event.h:84