mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-20 06:53:30 +00:00
58 lines
1.0 KiB
C++
Executable File
58 lines
1.0 KiB
C++
Executable File
#ifndef COM_MOJANG_NBT__ByteTag_H__
|
|
#define COM_MOJANG_NBT__ByteTag_H__
|
|
|
|
//package com.mojang.nbt;
|
|
|
|
/* import java.io.* */
|
|
|
|
#include "Tag.h"
|
|
#include <string>
|
|
|
|
class ByteTag: public Tag
|
|
{
|
|
typedef Tag super;
|
|
public:
|
|
char data;
|
|
|
|
ByteTag(const std::string& name)
|
|
: super(name)
|
|
{}
|
|
|
|
ByteTag(const std::string& name, char data)
|
|
: super(name),
|
|
data(data)
|
|
{
|
|
}
|
|
|
|
void write(IDataOutput* dos) /*throws IOException*/ {
|
|
dos->writeByte(data);
|
|
}
|
|
|
|
void load(IDataInput* dis) /*throws IOException*/ {
|
|
data = dis->readByte();
|
|
}
|
|
|
|
char getId() const {
|
|
return TAG_Byte;
|
|
}
|
|
|
|
std::string toString() const {
|
|
return std::string(data, 1);
|
|
}
|
|
|
|
//@Override
|
|
bool equals(const Tag& rhs) const {
|
|
if (super::equals(rhs)) {
|
|
return data == ((ByteTag&)rhs).data;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
//@Override
|
|
Tag* copy() const {
|
|
return new ByteTag(getName(), data);
|
|
}
|
|
};
|
|
|
|
#endif /*COM_MOJANG_NBT__ByteTag_H__*/
|