Geen omschrijving

project.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef PROJECT_H
  2. #define PROJECT_H
  3. #include "map.h"
  4. #include "blockdata.h"
  5. #include <QStringList>
  6. #include <QList>
  7. #include <QStandardItem>
  8. class Project
  9. {
  10. public:
  11. Project();
  12. QString root;
  13. QStringList *groupNames = NULL;
  14. QMap<QString, int> *map_groups;
  15. QList<QStringList> groupedMapNames;
  16. QStringList *mapNames = NULL;
  17. QMap<QString, QString>* mapConstantsToMapNames;
  18. QMap<QString, QString>* mapNamesToMapConstants;
  19. QMap<int, QString> mapAttributesTable;
  20. QMap<int, QString> mapAttributesTableMaster;
  21. QMap<QString, QMap<QString, QString>> mapAttributes;
  22. QMap<QString, QMap<QString, QString>> mapAttributesMaster;
  23. QMap<QString, Map*> *map_cache;
  24. Map* loadMap(QString);
  25. Map* getMap(QString);
  26. QMap<QString, Tileset*> *tileset_cache = NULL;
  27. Tileset* loadTileset(QString);
  28. Tileset* getTileset(QString);
  29. Blockdata* readBlockdata(QString);
  30. void loadBlockdata(Map*);
  31. QString readTextFile(QString path);
  32. void saveTextFile(QString path, QString text);
  33. void appendTextFile(QString path, QString text);
  34. void readMapGroups();
  35. Map* addNewMapToGroup(QString mapName, int groupNum);
  36. QString getNewMapName();
  37. QString getProjectTitle();
  38. QList<QStringList>* getLabelMacros(QList<QStringList>*, QString);
  39. QStringList* getLabelValues(QList<QStringList>*, QString);
  40. void readMapHeader(Map*);
  41. void readMapAttributesTable();
  42. void readAllMapAttributes();
  43. void readMapAttributes(Map*);
  44. void getTilesets(Map*);
  45. void loadTilesetAssets(Tileset*);
  46. QString getBlockdataPath(Map*);
  47. void saveBlockdata(Map*);
  48. void saveMapBorder(Map*);
  49. void writeBlockdata(QString, Blockdata*);
  50. void saveAllMaps();
  51. void saveMap(Map*);
  52. void saveAllDataStructures();
  53. void saveAllMapAttributes();
  54. void saveMapGroupsTable();
  55. void saveMapConstantsHeader();
  56. QList<QStringList>* parse(QString text);
  57. QStringList getSongNames();
  58. QString getSongName(int);
  59. QStringList getLocations();
  60. QStringList getVisibilities();
  61. QStringList getWeathers();
  62. QStringList getMapTypes();
  63. QStringList getBattleScenes();
  64. void loadObjectPixmaps(QList<Event*> objects);
  65. QMap<QString, int> getMapObjGfxConstants();
  66. QString fixGraphicPath(QString path);
  67. void readMapEvents(Map *map);
  68. void loadMapConnections(Map *map);
  69. void loadMapBorder(Map *map);
  70. QString getMapBorderPath(Map *map);
  71. void saveMapEvents(Map *map);
  72. QStringList readCArray(QString text, QString label);
  73. QString readCIncbin(QString text, QString label);
  74. QMap<QString, int> readCDefines(QString text, QStringList prefixes);
  75. private:
  76. QString getMapAttributesTableFilepath();
  77. QString getMapAssetsFilepath();
  78. void saveMapHeader(Map*);
  79. void saveMapAttributesTable();
  80. void updateMapAttributes(Map* map);
  81. void setNewMapHeader(Map* map, int mapIndex);
  82. void setNewMapAttributes(Map* map);
  83. void setNewMapBlockdata(Map* map);
  84. void setNewMapBorder(Map *map);
  85. void setNewMapEvents(Map *map);
  86. void setNewMapConnections(Map *map);
  87. };
  88. #endif // PROJECT_H