the whole game

This commit is contained in:
Kolyah35
2026-03-02 22:04:18 +03:00
parent 816e9060b4
commit f0617a5d22
2069 changed files with 581500 additions and 0 deletions

57
src/nbt/ByteTag.h Executable file
View 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__*/