mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-20 15:03:32 +00:00
the whole game
This commit is contained in:
57
src/nbt/ByteTag.h
Executable file
57
src/nbt/ByteTag.h
Executable file
@@ -0,0 +1,57 @@
|
||||
#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__*/
|
||||
Reference in New Issue
Block a user