From 7453a9fbe120f345625a24bbea18c35cd3c26a6a Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 2 Dec 2019 16:45:55 +0100 Subject: Moved ProtocolBlockTypePalette functionality into BlockTypePalette. --- src/Protocol/ProtocolBlockTypePalette.h | 40 --------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/Protocol/ProtocolBlockTypePalette.h (limited to 'src/Protocol/ProtocolBlockTypePalette.h') diff --git a/src/Protocol/ProtocolBlockTypePalette.h b/src/Protocol/ProtocolBlockTypePalette.h deleted file mode 100644 index fb156cfd5..000000000 --- a/src/Protocol/ProtocolBlockTypePalette.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once -#include -#include "../BlockState.h" - - -/** Parses and holds a collection of block types and their possible states -together with their corresponding Id within the Minecraft network protocol. */ -class ProtocolBlockTypePalette -{ -public: - static const UInt32 NOT_FOUND = UINT32_MAX; - - /** Create a new empty instance. */ - ProtocolBlockTypePalette(); - - /** Loads the palette from a string. - See loadFromStream() for further details. */ - bool loadFromString(const AString & aMapping); - - /** Loads the palette from an input stream. - Returns `true` on success, `false` otherwise. Sucessive calls to this method - will _add_ data to the palette. If duplicate keys are encountered, they will - be ignored and an info message logged. */ - bool loadFromStream(std::istream & aInputStream); - - /** Returns the defined index corresponding of the given aBlockTypeName and - aBlockState. - Returns ProtocolBlockTypePalette::NOT_FOUND if the tuple is not found. */ - UInt32 index(const AString & aBlockTypeName, const BlockState & aBlockState) const; - - /** Clears the palette. */ - void clear(); - - -protected: - - /** The palette index. Each item in the map represents a single block state - palette entry. The value is the block state ID. */ - std::unordered_map> mIndex; -}; -- cgit v1.2.3