From 85ae710d407eb31527183d5f8bec0399eb209f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 11 Nov 2017 01:38:31 +0100 Subject: GH-2026 implement changes necessary to support 1.13 snapshots --- api/logic/minecraft/ComponentList_p.h | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 api/logic/minecraft/ComponentList_p.h (limited to 'api/logic/minecraft/ComponentList_p.h') diff --git a/api/logic/minecraft/ComponentList_p.h b/api/logic/minecraft/ComponentList_p.h new file mode 100644 index 00000000..26ca5049 --- /dev/null +++ b/api/logic/minecraft/ComponentList_p.h @@ -0,0 +1,42 @@ +#pragma once + +#include "Component.h" +#include +#include +#include +#include + +class MinecraftInstance; +using ComponentContainer = QList; +using ComponentIndex = QMap; +using ConnectionList = QList; + +struct ComponentListData +{ + // the instance this belongs to + MinecraftInstance *m_instance; + + // the launch profile (volatile, temporary thing created on demand) + std::shared_ptr m_profile; + + // version information migrated from instance.cfg file. Single use on migration! + std::map m_oldConfigVersions; + QString getOldConfigVersion(const QString& uid) const + { + const auto iter = m_oldConfigVersions.find(uid); + if(iter != m_oldConfigVersions.cend()) + { + return (*iter).second; + } + return QString(); + } + + // persistent list of components and related machinery + ComponentContainer components; + ComponentIndex componentIndex; + bool dirty = false; + QTimer m_saveTimer; + shared_qobject_ptr m_updateTask; + bool loaded = false; +}; + -- cgit v1.2.3