#include "furnitureprofile.h" #include "furnitureprofilebuilder.h" #include QList FurnitureProfile::db; QMap FurnitureProfile::typemap; QMap FurnitureProfile::dbstr; FurnitureProfile* FurnitureProfile::byID(int i) { return db.value(i, NULL); } FurnitureProfile* FurnitureProfile::bySprite(QString t) { return dbstr.value(t, NULL); } void FurnitureProfile::init(){ printf("Initializing FurnitureProfile Database...\n"); // I moved the thing that calls thise to try to fix something, sec typemap.insert("solid", SolidType); typemap.insert("sit", SitType); typemap.insert("rug", RugType); typemap.insert("roller", RollerType); typemap.insert("poster", PosterType); typemap.insert("floor", FloorType); typemap.insert("door", DoorType); typemap.insert("bed", BedType); FurnitureProfileBuilder b; b.buildFurnitureProfile(&db); printf(" %i Furniture profiles in Database, injecting...", db.size()); foreach(FurnitureProfile* f, db){ dbstr.insert(f->sprite, f); } printf(" [OK]\n"); } FurnitureProfile::FurnitureProfile(int i, QString s, QString t, QString n, int y, QString v, QString c, QString f, int w, int h, int st) { id = i; sprite = s; typestr = t; type = typeFromString(t); name = n; sitheight = y; var = v; cust = c; flag = f; width = w; height = h; stack = st; }