#ifndef REDREAM_H #define REDREAM_H #include #include #include #include typedef std::map PlistDict; typedef std::vector PlistArray; class Redream { public: static Redream* getInstance(); /** * @brief 创建房间时创建一个red模版 * @return */ bool createRedream(QString filePath); /** * @brief 创建物件时导入red文件 * @return */ void addObjectToRedream(std::string filePath, std::vector object); /** * @brief 从red文件中删除一个物件 * @return */ void deleteObjectFromRedream(std::string filePath, std::vector object); /** * @brief 从red文件中获取时间线信息 * @return */ QList getTimelineFromRedream(std::string filePath); /** * @brief 创建家具时导入red文件 * @return */ void addFurnitureToRedream(std::string filePath, std::string furnitureId); /** * @brief 从red文件中删除一个家具 * @return */ void deleteFurnitureFromRedream(std::string filePath, std::string furnitureId); /** * @brief 查询家具的位置信息 * @return */ std::array getFurniturePos(std::string filePath, std::string furnitureId); /** * @brief 误操作可能会导致家具节点丢失, 检查家具是否丢失,如果已丢失,则在特定地方重新创建一下 * @return */ void checkFurnitureIsLost(std::string filePath, std::string furnitureId); //redream节点丢失问题 void syncAllFurnitureRedreamNodes(QString roomId); int getFurnitureLocalZOrder(std::string filePath, std::string furnitureId); private: PlistDict _addChildren(std::string furnitureId); PlistArray _addProperties(std::string furnitureId); }; #endif // REDREAM_H