-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngine.cpp
More file actions
554 lines (436 loc) · 19.6 KB
/
Copy pathEngine.cpp
File metadata and controls
554 lines (436 loc) · 19.6 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
#include <iostream>
#include "PreprocessorDirectves.h"
#include "Engine.h"
#include "Utilities.h"
#include "SharedContext.h"
#include "Scenario_Basic.h"
#include "Organism.h"
static const sf::Color S_BG_COLOR{ 240,240,240 };
static const unsigned S_FPS{ 30 };
static const unsigned S_NUM_FOOD{ 200U };
static const float S_ENERGY{ 300000 };
static const unsigned S_NUM_ORGANISMS{ 15U };
static const float S_SIMULATION_WIDTH{ 3000.f };
static const float S_SIMULATION_HEIGHT{ 3000.f };
////////////////////////////////////////////////////////////
Engine::Engine(const sf::Vector2u& t_windowSize, const std::string& t_windowName) :
m_windowSize{ t_windowSize },
m_keyboard{ Keyboard() },
m_eventHandler{ EventHandler() },
m_state{ EngineState::Init },
m_window{ sf::VideoMode(t_windowSize.x, t_windowSize.y), t_windowName },
m_scenario{ nullptr },
m_rng{},
m_resourceHolder{},
m_context{},
m_maxFramerate{ S_FPS },
m_collisionManager{ this, sf::FloatRect() }
{
m_context.m_engine = this;
m_context.m_resourceHolder = &m_resourceHolder;
m_context.m_rng = &m_rng;
m_context.m_window = &m_window;
m_window.setFramerateLimit(m_maxFramerate);
init();
update(); // Run a single tick to place verything
m_state = EngineState::Paused;
}
////////////////////////////////////////////////////////////
void Engine::init() {
// Set default view settins
m_viewSpeed = 300.f;
m_viewZoom = 0.05f;
resetView();
// Initialize all actions with empty kebindings
for (const auto& it : s_actions) {
m_eventHandler.addAction(std::move(createAction(it.first)));
}
// Add all the keybindings
if (!parseBindings("keybindings.txt")) {
std::cout << "Press Enter to exit.\n";
std::cin.get();
std::exit(1);
}
// Read in all the resources in the dedicated directory
m_resourceHolder.init();
// Initialize simulation scenario
m_scenario = std::make_unique<Scenario_Basic>(m_context, S_ENERGY,S_NUM_ORGANISMS, 100U, S_NUM_FOOD, S_NUM_FOOD, S_SIMULATION_WIDTH, S_SIMULATION_HEIGHT);
m_scenario->init();
// Set the size of the quadtree root
m_collisionManager.setBounds(m_scenario->getSimulationRect());
}
////////////////////////////////////////////////////////////
void Engine::update() {
const float elapsed{ m_elapsed.asSeconds() };
if (m_state == EngineState::Paused) { return; }
// Spanwn actors from spawn list
for (auto actor_it{ m_spawnList.begin() }; actor_it != m_spawnList.end();) {
// Check if the actor is able to spawn given the conditions of the simulation
if ((*actor_it)->canSpawn(m_context)) {
// Move them to the spawned actors list
m_actors.emplace_back(std::move(*actor_it));
actor_it = m_spawnList.erase(actor_it);
// Apply their spawn effect
m_actors.back()->onSpawn(m_context);
}
else { actor_it++; }
}
// Update actors and delete the wasted ones
for (auto it{ m_actors.begin() }; it < m_actors.end();) {
auto& actor{ *it->get() };
if (actor.shouldBeDestroyed()) {
actor.onDestruction(m_context);
it = m_actors.erase(it);
}
else {
actor.update(elapsed);
it++;
}
}
m_scenario->update(elapsed);
// Build the collision quadtree
m_collisionManager.update();
}
////////////////////////////////////////////////////////////
const EngineState& Engine::getState()const { return m_state; }
////////////////////////////////////////////////////////////
bool Engine::executeAction(const ActionId& t_id, const EventInfo& t_info) {
return m_eventHandler.executeAction(t_id, t_info);
}
////////////////////////////////////////////////////////////
sf::Time Engine::getElapsed()const { return m_elapsed; }
////////////////////////////////////////////////////////////
const sf::FloatRect& Engine::getSimulationRect()const { return m_scenario->getSimulationRect(); }
////////////////////////////////////////////////////////////
void Engine::run() {
// Window loop
while (m_window.isOpen()) {
// Restar the clock and capture elapsed time
m_elapsed = m_clock.restart();
pollEvents();
update();
render();
}
}
////////////////////////////////////////////////////////////
void Engine::pollEvents() {
m_keyboard.reset();
const auto& pressedKeys{ m_keyboard.getPressedKeys() };
const auto& releasedKeys{ m_keyboard.getReleasedKeys() };
sf::Event e;
while (m_window.pollEvent(e)) {
m_keyboard.handleKeyboardInput(e); // Updte keyboard
// #%#
// #%%#
// %#
// | |
// | |\|\|\|\|\
// sf::Event -> | __ | -> EventInfo
// |__| |_____|
EventInfo eventInfo(m_state, pressedKeys, releasedKeys, m_elapsed.asSeconds());
m_eventHandler.handleEvent(eventInfo);
switch (e.type) {
case sf::Event::Resized:
m_window.setSize(m_windowSize);
break;
case sf::Event::Closed:
m_window.close();
break;
}
}
}
////////////////////////////////////////////////////////////
float Engine::getRandom(const float& t_min, const float& t_max) { return m_rng(t_min, t_max); }
////////////////////////////////////////////////////////////
int Engine::getRandom(const int& t_min, const int& t_max) { return m_rng(t_min, t_max); }
////////////////////////////////////////////////////////////
sf::RenderWindow& Engine::getWindow() {
return m_window;
}
////////////////////////////////////////////////////////////
void Engine::render() {
// Apply the engine view to the window
m_window.setView(m_view);
// Clear the window
m_window.clear(S_BG_COLOR);
// Draw any scenery placed by the scenario
m_scenario->draw();
#if defined(_DEBUG) && IS_DRAW_COLLISION_QUADTREE == 1
m_collisionManager.draw(m_window); // Draw the collision quadtree (debug)
#endif // defined(_DEBUG) && IS_DRAW_COLLISION_QUADTREE == 1
// Draw the actors
for (auto& actor : m_actors) {
actor->draw();
#if defined(_DEBUG) && IS_DRAW_ACTOR_AABB == 1
actor->getCollider().draw(m_window);
#endif // defined(_DEBUG) && IS_DRAW_ACTOR_AABB == 1
}
m_window.display();
}
////////////////////////////////////////////////////////////
bool Engine::parseBindings(const std::string& t_fileNameWithPath, const std::string& t_bindingIdentifier) {
std::stringstream stream;
if (!utilities::readFile(t_fileNameWithPath, stream, false)) {
std::cerr << "@ ERROR: Cannot parse keyboard bindings file \"" << t_fileNameWithPath << '\"' << std::endl;
return false;
}
std::string token;
while (stream >> token) {
if (token == t_bindingIdentifier) {
std::string action;
std::string key;
stream >> action >> key;
auto actionId{ actionStrToId(action) };
if (actionId == ActionId::INVALID_ACTION) {
std::cerr << "! WARNING: Invalid action \"" << action << "\" in file \"" << t_fileNameWithPath << '\"' << std::endl;
continue;
} // Invalid action; try to read a new binding
auto keyId{ Keyboard::getKeyId(key) };
if (m_keyboard.getKeyId(key) == sf::Keyboard::Unknown) {
std::cout << "! WARNING: Invalid key \"" << key << "\" in file \"" << t_fileNameWithPath << '\"' << std::endl;
continue;
}// Invalid key; try to read a new binding
if (!m_eventHandler.addKey(actionId, keyId)) {
std::cerr << "! WARNING: Failed to add key \"" << key << "\" to action \"" << action << '\"' << std::endl;
}
m_keyboard.listenToKey(keyId); // Tell the keyboard to listen to the key
}
else { continue; }// The token wasn't the line identifier; skip it
}
return true;
}
////////////////////////////////////////////////////////////
float Engine::getViewChangeSpeed()const { return m_viewSpeed; }
////////////////////////////////////////////////////////////
void Engine::setViewChangeSpeed(const float& t_speed) { m_viewSpeed = t_speed; }
////////////////////////////////////////////////////////////
float Engine::getZoom()const { return m_viewZoom; }
////////////////////////////////////////////////////////////
void Engine::setZoom(const float& t_zoom) { m_viewZoom = t_zoom; }
////////////////////////////////////////////////////////////
unsigned Engine::getMaxFramerate()const { return m_maxFramerate; }
////////////////////////////////////////////////////////////
void Engine::setMaxFramerate(const unsigned& t_fps) {
m_maxFramerate = t_fps;
m_window.setFramerateLimit(m_maxFramerate);
}
////////////////////////////////////////////////////////////
void Engine::resetView() {
m_view = sf::View();
m_view.setCenter(static_cast<float>(S_SIMULATION_WIDTH) * 0.5f, static_cast<float>(S_SIMULATION_HEIGHT) * 0.5f);
}
////////////////////////////////////////////////////////////
const Scenario_Basic& Engine::getScenario() const { return *m_scenario.get(); }
////////////////////////////////////////////////////////////
Scenario_Basic& Engine::getScenario() { return *m_scenario.get(); }
////////////////////////////////////////////////////////////
void Engine::spawnActor(ActorPtr t_actor) {
m_spawnList.emplace_back(std::move(t_actor)); }
static const std::string S_EMPTY_STR{ "" };
const StateNames Engine::s_stateNames{
{"EngineState_Init", EngineState::Init},
{"EngineState_Paused", EngineState::Paused},
{"EngineState_Running", EngineState::Running}
};
//////////////////////////////////////////////////////////
const std::string& Engine::getStateStr(const EngineState& t_stateId) {
auto it{ std::find_if(s_stateNames.cbegin(), s_stateNames.cend(),
[&t_stateId](const std::pair<std::string, EngineState> t_p) {return t_p.second == t_stateId; }) };
return (it == s_stateNames.cend() ? S_EMPTY_STR : it->first);
}
//////////////////////////////////////////////////////////
EngineState Engine::getStateId(const std::string& t_stateName) {
auto it{ s_stateNames.find(t_stateName) };
return (it == s_stateNames.cend() ? EngineState::INVALID_STATE : it->second);
}
//////////////////////////////////////////////////////////
const ActionFactory Engine::s_actions{
{ActionId::Unpause, {"Action_Unpause", EngineState::Paused, ActionTrigger::SingleKeyRelease, &Engine::Action_Unpause}},
{ActionId::Save, {"Action_Save", EngineState::Paused, ActionTrigger::SingleKeyRelease, &Engine::Action_Save}},
{ActionId::Quit, {"Action_Quit", EngineState::Paused, ActionTrigger::SingleKeyRelease, &Engine::Action_Quit}},
{ActionId::Pause, {"Action_Pause", EngineState::Running, ActionTrigger::SingleKeyRelease, &Engine::Action_Pause}},
{ActionId::MoveViewUp, {"Action_MoveViewUp", EngineState::Running, ActionTrigger::ContinousKeyPress, &Engine::Action_MoveViewUp}},
{ActionId::MoveViewUp_Paused, {"Action_MoveViewUp_Paused", EngineState::Paused, ActionTrigger::ContinousKeyPress, &Engine::Action_MoveViewUp_Paused}},
{ActionId::MoveViewDown, {"Action_MoveViewDown", EngineState::Running, ActionTrigger::ContinousKeyPress, &Engine::Action_MoveViewDown}},
{ActionId::MoveViewDown_Paused, {"Action_MoveViewDown_Paused", EngineState::Paused, ActionTrigger::ContinousKeyPress, &Engine::Action_MoveViewDown_Paused}},
{ActionId::MoveViewLeft, {"Action_MoveViewLeft", EngineState::Running, ActionTrigger::ContinousKeyPress, &Engine::Action_MoveViewLeft}},
{ActionId::MoveViewLeft_Paused, {"Action_MoveViewLeft_Paused", EngineState::Paused, ActionTrigger::ContinousKeyPress, &Engine::Action_MoveViewLeft_Paused}},
{ActionId::MoveViewRight, {"Action_MoveViewRight", EngineState::Running, ActionTrigger::ContinousKeyPress, &Engine::Action_MoveViewRight}},
{ActionId::MoveViewRight_Paused, {"Action_MoveViewRight_Paused", EngineState::Paused, ActionTrigger::ContinousKeyPress, &Engine::Action_MoveViewRight_Paused}},
{ActionId::ResetView, {"Action_ResetView", EngineState::Running, ActionTrigger::SingleKeyRelease, &Engine::Action_ResetView}},
{ActionId::ResetView_Paused, {"Action_ResetView_Paused", EngineState::Paused, ActionTrigger::SingleKeyRelease, &Engine::Action_ResetView_Paused}},
{ActionId::ZoomIn, {"Action_ZoomIn", EngineState::Running, ActionTrigger::ContinousKeyPress, &Engine::Action_ZoomIn}},
{ActionId::ZoomIn_Paused, {"Action_ZoomIn_Paused", EngineState::Paused, ActionTrigger::ContinousKeyPress, &Engine::Action_ZoomIn_Paused}},
{ActionId::ZoomOut, {"Action_ZoomOut", EngineState::Running, ActionTrigger::ContinousKeyPress, &Engine::Action_ZoomOut}},
{ActionId::ZoomOut_Paused, {"Action_ZoomOut_Paused", EngineState::Paused, ActionTrigger::ContinousKeyPress, &Engine::Action_ZoomOut_Paused}},
{ActionId::ResetZoom, {"Action_ResetZoom", EngineState::Running, ActionTrigger::SingleKeyRelease, &Engine::Action_ResetZoom}},
{ActionId::ResetZoom_Paused, {"Action_ResetZoom_Paused", EngineState::Paused, ActionTrigger::SingleKeyRelease, &Engine::Action_ResetZoom_Paused}}
};
////////////////////////////////////////////////////////////
const std::string& Engine::actionIdToStr(const ActionId& t_id) {
auto it{ s_actions.find(t_id) };
return (it == s_actions.cend() ? S_EMPTY_STR : std::get<ACTION_NAME>(it->second));
}
////////////////////////////////////////////////////////////
ActionId Engine::actionStrToId(const std::string& t_name) {
auto it{ std::find_if(s_actions.cbegin(), s_actions.cend(),
[t_name](const std::pair<ActionId,ActionTuple>& t_p) {return std::get<ACTION_NAME>(t_p.second) == t_name; }) };
return (it == s_actions.cend() ? ActionId::INVALID_ACTION : it->first);
}
////////////////////////////////////////////////////////////
std::unique_ptr<Action> Engine::createAction(const ActionId& t_id) {
auto it{ s_actions.find(t_id) };
if (it == s_actions.cend()) { return nullptr; }
return std::make_unique<Action>(t_id,
std::get<ACTION_ENGINE_STATE>(it->second),
std::get<ACTION_NAME>(it->second),
std::get<ACTION_TRIGGER>(it->second),
std::bind(std::get<ACTION_FUNCTOR>(it->second), this, std::placeholders::_1));
}
// --------------------------------------------------------------------------------------------------- ACTIONS
////////////////////////////////////////////////////////////
void Engine::Action_Pause(const EventInfo& t_info) {
m_state = EngineState::Paused;
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tPause" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_Unpause(const EventInfo& t_info) {
m_state = EngineState::Running;
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tUnpause" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_MoveViewLeft(const EventInfo& t_info) {
m_view.move(-m_viewSpeed * getElapsed().asSeconds(), 0.f);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tMoveViewLeft" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_MoveViewLeft_Paused(const EventInfo& t_info) {
m_view.move(-m_viewSpeed * getElapsed().asSeconds(), 0.f);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tMoveViewLeft_Paused" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_MoveViewRight(const EventInfo& t_info) {
m_view.move(m_viewSpeed * getElapsed().asSeconds(), 0.f);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tMoveViewRight" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_MoveViewRight_Paused(const EventInfo& t_info) {
m_view.move(m_viewSpeed * getElapsed().asSeconds(), 0.f);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tMoveViewRight_Paused" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_MoveViewUp(const EventInfo& t_info) {
m_view.move(0.f, -m_viewSpeed * getElapsed().asSeconds()); // -y = up
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tMoveViewUp" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_MoveViewUp_Paused(const EventInfo& t_info) {
m_view.move(0.f, -m_viewSpeed * getElapsed().asSeconds()); // -y = up
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tMoveViewUp_Paused" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_MoveViewDown(const EventInfo& t_info) {
m_view.move(0.f, m_viewSpeed * getElapsed().asSeconds()); // +y = down
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tMoveViewDown" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_MoveViewDown_Paused(const EventInfo& t_info) {
m_view.move(0.f, m_viewSpeed * getElapsed().asSeconds()); // +y = down
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tMoveViewDown_Paused" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_ResetView(const EventInfo& t_info) {
m_view = sf::View();
m_view.setCenter(static_cast<float>(m_windowSize.x) / 2, static_cast<float>(m_windowSize.y) / 2);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tResetView" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_ResetView_Paused(const EventInfo& t_info) {
resetView();
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tResetView_Paused" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_ZoomIn(const EventInfo& t_info) {
m_view.zoom(1.f - m_viewZoom);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tZoomIn" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_ZoomIn_Paused(const EventInfo& t_info) {
m_view.zoom(1.f - m_viewZoom);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tZoomIn_Paused" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_ZoomOut(const EventInfo& t_info) {
m_view.zoom(1.f + m_viewZoom);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tZoomOut" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_ZoomOut_Paused(const EventInfo& t_info) {
m_view.zoom(1.f + m_viewZoom);
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tZoomOut_Paused" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_ResetZoom(const EventInfo& t_info) {
resetView();
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tResetZoom" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_ResetZoom_Paused(const EventInfo& t_info) {
resetView();
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tResetZoom_Paused" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_Save(const EventInfo& t_info) {
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tSave" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_Quit(const EventInfo& t_info) {
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tQuit" << std::endl;
#endif
}
////////////////////////////////////////////////////////////
void Engine::Action_INVALID_ACTION(const EventInfo& t_info) {
#if defined(_DEBUG) && IS_PRINT_TRIGGERED_ACTIONS_TO_CONSOLE == 1
std::cout << "> ACTION\tINVALID_ACTION" << std::endl;
#endif
}
// --------------------------------------------------------------------------------------------------- ACTIONS