Files
MinecraftConsoles/Minecraft.Client/Common/DLC/DLCGameRulesHeader.h
ModMaker101 a9be52c41a Project modernization (#630)
* Fixed boats falling and a TP glitch #266

* Replaced every C-style cast with C++ ones

* Replaced every C-style cast with C++ ones

* Fixed boats falling and a TP glitch #266

* Updated NULL to nullptr and fixing some type issues

* Modernized and fixed a few bugs

- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.

* Fixing more conflicts

* Replace int loops with size_t and start work on overrides
2026-03-08 09:56:03 +07:00

65 lines
1.4 KiB
C++

#pragma once
#include "DLCGameRules.h"
#include "..\GameRules\LevelGenerationOptions.h"
class DLCGameRulesHeader : public DLCGameRules, public JustGrSource
{
private:
// GR-Header
PBYTE m_pbData;
DWORD m_dwBytes;
bool m_hasData;
public:
bool requiresTexturePack() override
{return m_bRequiresTexturePack;}
UINT getRequiredTexturePackId() override
{return m_requiredTexturePackId;}
wstring getDefaultSaveName() override
{return m_defaultSaveName;}
LPCWSTR getWorldName() override
{return m_worldName.c_str();}
LPCWSTR getDisplayName() override
{return m_displayName.c_str();}
wstring getGrfPath() override
{return L"GameRules.grf";}
void setRequiresTexturePack(bool x) override
{m_bRequiresTexturePack = x;}
void setRequiredTexturePackId(UINT x) override
{m_requiredTexturePackId = x;}
void setDefaultSaveName(const wstring &x) override
{m_defaultSaveName = x;}
void setWorldName(const wstring & x) override
{m_worldName = x;}
void setDisplayName(const wstring & x) override
{m_displayName = x;}
void setGrfPath(const wstring & x) override
{m_grfPath = x;}
LevelGenerationOptions *lgo;
public:
DLCGameRulesHeader(const wstring &path);
void addData(PBYTE pbData, DWORD dwBytes) override;
PBYTE getData(DWORD &dwBytes) override;
void setGrfData(PBYTE fData, DWORD fSize, StringTable *);
bool ready() override
{ return m_hasData; }
};