From 2e7781f7f0b92af1fd9bb8b297089137b0b16ad4 Mon Sep 17 00:00:00 2001 From: "admin@omencraft.com" Date: Mon, 31 Oct 2011 02:24:44 +0000 Subject: More changes to the denotch map converter. Added some tags. Still debugging some parsing issues. git-svn-id: http://mc-server.googlecode.com/svn/trunk@30 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- converter/cNBTData.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'converter/cNBTData.h') diff --git a/converter/cNBTData.h b/converter/cNBTData.h index 4d5ec0beb..d3e5e82b6 100644 --- a/converter/cNBTData.h +++ b/converter/cNBTData.h @@ -38,7 +38,9 @@ public: void PutByte( std::string Name, char Value ) { m_Bytes[Name] = Value; } void PutShort( std::string Name, short Value ) { m_Shorts[Name] = Value; } void PutInteger( std::string Name, int Value ) { m_Integers[Name] = Value; } - void PutLong( std::string Name, long Value ) { m_Longs[Name] = Value; } + void PutLong( std::string Name, long long Value ) { m_Longs[Name] = Value; } + void PutDouble( std::string Name, double Value ) { m_Doubles[Name] = Value; } + void PutFloat( std::string Name, float Value ) { m_Floats[Name] = Value; } void PutString( std::string Name, std::string Value ) { m_Strings[Name] = Value; } void PutByteArray( std::string Name, char* ByteArray ) { m_ByteArrays[Name] = ByteArray; } void PutCompound( std::string Name ); @@ -47,7 +49,9 @@ public: char GetByte( std::string Name ) { return m_Bytes[Name]; } short GetShort( std::string Name ) { return m_Shorts[Name]; } int GetInteger( std::string Name ) { return m_Integers[Name]; } - long GetLong( std::string Name ) { return m_Longs[Name]; } + long long GetLong( std::string Name ) { return m_Longs[Name]; } + double GetDouble( std::string Name ) { return m_Doubles[Name]; } + float GetFloat( std::string Name ) { return m_Floats[Name]; } std::string GetString( std::string Name ) { return m_Strings[Name]; } char* GetByteArray( std::string Name ) { return m_ByteArrays[Name]; } cNBTCompound* GetCompound( std::string Name ); @@ -72,7 +76,9 @@ private: typedef std::map ByteMap; typedef std::map ShortMap; typedef std::map IntegerMap; - typedef std::map LongMap; + typedef std::map LongMap; + typedef std::map DoubleMap; + typedef std::map FloatMap; typedef std::map StringMap; typedef std::map ByteArrayMap; typedef std::map CompoundMap; @@ -81,6 +87,8 @@ private: ShortMap m_Shorts; IntegerMap m_Integers; LongMap m_Longs; + DoubleMap m_Doubles; + FloatMap m_Floats; StringMap m_Strings; ByteArrayMap m_ByteArrays; CompoundMap m_Compounds; @@ -131,14 +139,18 @@ public: void PutByte( std::string Name, char Value ) { m_CurrentCompound->PutByte( Name, Value ); } void PutShort( std::string Name, short Value ) { m_CurrentCompound->PutShort( Name, Value ); } void PutInteger( std::string Name, int Value ) { m_CurrentCompound->PutInteger( Name, Value ); } - void PutLong( std::string Name, long Value ) { m_CurrentCompound->PutLong( Name, Value ); } - void PutString( std::string Name, std::string Value ) { m_CurrentCompound->PutString(Name, Value); } + void PutLong( std::string Name, long long Value ) { m_CurrentCompound->PutLong( Name, Value ); } + void PutDouble( std::string Name, double Value ) { m_CurrentCompound->PutDouble( Name, Value ); } + void PutFloat( std::string Name, float Value ) { m_CurrentCompound->PutFloat( Name, Value ); } + void PutString( std::string Name, std::string Value ) { m_CurrentCompound->PutString( Name, Value ); } void PutByteArray( std::string Name, char* ByteArray ) { m_CurrentCompound->PutByteArray( Name, ByteArray ); } void PutCompound( std::string Name ) { m_CurrentCompound->PutCompound( Name ); } void PutList( std::string Name, ENUM_TAG Type ) { m_CurrentCompound->PutList( Name, Type ); } int GetInteger( std::string Name ) { return m_CurrentCompound->GetInteger(Name); } - long GetLong( std::string Name ) { return m_CurrentCompound->GetLong(Name); } + long long GetLong( std::string Name ) { return m_CurrentCompound->GetLong(Name); } + double GetDouble( std::string Name ) { return m_CurrentCompound->GetDouble(Name); } + float GetFloat( std::string Name ) { return m_CurrentCompound->GetFloat(Name); } std::string GetString( std::string Name ) { return m_CurrentCompound->GetString(Name); } char* GetByteArray( std::string Name ) { return m_CurrentCompound->GetByteArray(Name); } cNBTCompound* GetCompound( std::string Name ) { return m_CurrentCompound->GetCompound(Name); } @@ -163,6 +175,8 @@ private: void ParseByteArray( bool a_bNamed ); void ParseInt( bool a_bNamed ); void ParseLong( bool a_bNamed ); + void ParseDouble( bool a_bNamed ); + void ParseFloat( bool a_bNamed ); void ParseShort( bool a_bNamed ); short ReadShort(); @@ -170,12 +184,15 @@ private: char ReadByte(); int ReadInt(); long long ReadLong(); + double ReadDouble(); + float ReadFloat(); cNBTCompound* m_CurrentCompound; char* m_Buffer; unsigned int m_BufferSize; unsigned int m_Index; + bool tm; void (cNBTData::*m_ParseFunctions[TAG_NumTags])(bool); }; -- cgit v1.2.3