mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 09:03:42 +00:00
#58 added exception for missing game implementation
This commit is contained in:
parent
3d639b89d0
commit
a8e046ce07
@ -5,6 +5,7 @@
|
||||
#include <map>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "Game.h"
|
||||
|
||||
@ -36,8 +37,10 @@ public:
|
||||
}
|
||||
|
||||
Game* create(GameInternal* gameInternal) {
|
||||
if (this->creatorFunc == nullptr)
|
||||
if (this->creatorFunc == nullptr) {
|
||||
throw std::runtime_error("No game implementation registered!");
|
||||
return nullptr;
|
||||
}
|
||||
Game* game = (this->creatorFunc)();
|
||||
game->gameInternal = gameInternal;
|
||||
return game;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user