From 0d3e719b8dd1d1159564f118db74f405a86c500f Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Tue, 18 Jun 2019 06:14:29 +0530 Subject: HDB: Add the AI class to hdb.cpp --- engines/hdb/hdb.cpp | 6 ++++++ engines/hdb/hdb.h | 1 + 2 files changed, 7 insertions(+) diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index d7df7ef981..03e5d694b3 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -46,6 +46,7 @@ HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst _drawMan = new DrawMan; _lua = new LuaScript; _map = new Map; + _ai = new AI; _rnd = new Common::RandomSource("hdb"); DebugMan.addDebugChannel(kDebugExample1, "Example1", "This is just an example to test"); @@ -58,6 +59,7 @@ HDBGame::~HDBGame() { delete _drawMan; delete _lua; delete _map; + delete _ai; delete _rnd; DebugMan.clearAllDebugChannels(); @@ -74,6 +76,10 @@ bool HDBGame::init() { error("FileMan::openMPC: Cannot find the hyperspace.mpc data file."); return false; } + if (!_ai->init()) { + error("AI::init: Couldn't initialize AI"); + return false; + } if (!_drawMan->init()) { error("DrawMan::init: Couldn't initialize DrawMan"); return false; diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h index 613a1cdf39..f548bed92e 100644 --- a/engines/hdb/hdb.h +++ b/engines/hdb/hdb.h @@ -101,6 +101,7 @@ public: DrawMan *_drawMan; LuaScript *_lua; Map *_map; + AI *_ai; // Random Source Common::RandomSource *_rnd; -- cgit v1.2.3