2 #include "MapObjectFactory.h"
3 #include "MapObjectType.h"
4 #include "QueryGenerator.h"
8 int status
= sqlite3_open(ASGARD_DATABASE
, &this->asgardDb
);
10 if(status
!= SQLITE_OK
)
12 sqlite3_close(this->asgardDb
);
15 // TODO: Add some type of logging for status
20 sqlite3_close(this->asgardDb
);
23 void Database::determineVisibleBoxes(Coordinate currentPosition
, int *visibleBoxes
, int numVisibleBoxes
)
27 bool Database::loadBoundingBox(int boxId
)
29 char **sqliteErrorCode
;
31 sqlite3_exec(this->asgardDb
, QueryGenerator::container(boxId
), MapObjectFactory::processRow
, (void*)(MAP_OBJECT_TYPE_CONTAINER
), sqliteErrorCode
);
32 sqlite3_exec(this->asgardDb
, QueryGenerator::nonPlayerCharacter(boxId
), MapObjectFactory::processRow
, (void*)MAP_OBJECT_TYPE_NON_PLAYER_CHARACTER
, sqliteErrorCode
);
33 sqlite3_exec(this->asgardDb
, QueryGenerator::staticMapObject(boxId
), MapObjectFactory::processRow
, (void*)MAP_OBJECT_TYPE_STATIC_MAP_OBJECT
, sqliteErrorCode
);
34 sqlite3_exec(this->asgardDb
, QueryGenerator::tile(boxId
), MapObjectFactory::processRow
, (void*)MAP_OBJECT_TYPE_TILE
, sqliteErrorCode
);