the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2using namespace std;
3#include "DLCManager.h"
4
5class DLCFile;
6class DLCSkinFile;
7
8class DLCPack
9{
10private:
11 vector<DLCFile *> m_files[DLCManager::e_DLCType_Max];
12 vector<DLCPack *> m_childPacks;
13 DLCPack *m_parentPack;
14
15 unordered_map<int, wstring> m_parameters;
16
17 wstring m_packName;
18 wstring m_dataPath;
19 DWORD m_dwLicenseMask;
20 int m_dlcMountIndex;
21 XCONTENTDEVICEID m_dlcDeviceID;
22#ifdef _XBOX_ONE
23 wstring m_wsProductId;
24#else
25 ULONGLONG m_ullFullOfferId;
26#endif
27 bool m_isCorrupt;
28 DWORD m_packId;
29 DWORD m_packVersion;
30
31 PBYTE m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children.
32public:
33
34 DLCPack(const wstring &name,DWORD dwLicenseMask);
35#ifdef _XBOX_ONE
36 DLCPack(const wstring &name,const wstring &productID,DWORD dwLicenseMask);
37#endif
38 ~DLCPack();
39
40 wstring getFullDataPath() { return m_dataPath; }
41
42 void SetDataPointer(PBYTE pbData) { m_data = pbData; }
43
44 bool IsCorrupt() { return m_isCorrupt; }
45 void SetIsCorrupt(bool val) { m_isCorrupt = val; }
46
47 void SetPackId(DWORD id) { m_packId = id; }
48 DWORD GetPackId() { return m_packId; }
49
50 void SetPackVersion(DWORD version) { m_packVersion = version; }
51 DWORD GetPackVersion() { return m_packVersion; }
52
53 DLCPack * GetParentPack() { return m_parentPack; }
54 DWORD GetParentPackId() { return m_parentPack->m_packId; }
55
56 void SetDLCMountIndex(DWORD id) { m_dlcMountIndex = id; }
57 DWORD GetDLCMountIndex();
58 void SetDLCDeviceID(XCONTENTDEVICEID deviceId) { m_dlcDeviceID = deviceId; }
59 XCONTENTDEVICEID GetDLCDeviceID();
60
61 void addChildPack(DLCPack *childPack);
62 void setParentPack(DLCPack *parentPack);
63
64 void addParameter(DLCManager::EDLCParameterType type, const wstring &value);
65 bool getParameterAsUInt(DLCManager::EDLCParameterType type, unsigned int ¶m);
66
67 void updateLicenseMask( DWORD dwLicenseMask ) { m_dwLicenseMask = dwLicenseMask; }
68 DWORD getLicenseMask( ) { return m_dwLicenseMask; }
69
70 wstring getName() { return m_packName; }
71
72 void UpdateLanguage();
73#ifdef _XBOX_ONE
74 wstring getPurchaseOfferId() { return m_wsProductId; }
75#else
76 ULONGLONG getPurchaseOfferId() { return m_ullFullOfferId; }
77#endif
78
79 DLCFile *addFile(DLCManager::EDLCType type, const wstring &path);
80 DLCFile *getFile(DLCManager::EDLCType type, DWORD index);
81 DLCFile *getFile(DLCManager::EDLCType type, const wstring &path);
82
83 DWORD getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All);
84 DWORD getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found);
85 bool doesPackContainFile(DLCManager::EDLCType type, const wstring &path);
86 DWORD GetPackID() {return m_packId;}
87
88 DWORD getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); }
89 DWORD getSkinIndexAt(const wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); }
90 DLCSkinFile *getSkinFile(const wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); }
91 DLCSkinFile *getSkinFile(DWORD index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); }
92 bool doesPackContainSkin(const wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); }
93
94 bool hasPurchasedFile(DLCManager::EDLCType type, const wstring &path);
95};