void Manager::addEntity(Entity& entity) { auto entityTypes = entity.getComponentTypes(); for (auto t : entityTypes) { auto systems = getSystems(t); for (auto s : systems) { s->onAddEntity(entity); } } entities_.push_back(&entity); }
void getGameDb(gamedb* db) { db->nbSystems = 0; db->systems = NULL; MYSQL* conn; //init mysql conn=mysql_init(NULL); if(!mysql_real_connect(conn,"gamedb.ccyrykcpfupb.eu-central-1.rds.amazonaws.com","d_idea","idea1234","gamedb",0,NULL,0)) { printf( "Failed to connect to MySQL: Error: %s\n",mysql_error(conn)); } else { //get systems getSystems(db, conn); } //cleanup mysql_close(conn); }
bool ftParser::parse(void) { return getSystems() && assignIndexes(); }