the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include <ostream>
3#include "InputOutputStream.h"
4using namespace std;
5
6
7class Tag
8{
9public:
10 static const byte TAG_End = 0;
11 static const byte TAG_Byte = 1;
12 static const byte TAG_Short = 2;
13 static const byte TAG_Int = 3;
14 static const byte TAG_Long = 4;
15 static const byte TAG_Float = 5;
16 static const byte TAG_Double = 6;
17 static const byte TAG_Byte_Array = 7;
18 static const byte TAG_String = 8;
19 static const byte TAG_List = 9;
20 static const byte TAG_Compound = 10;
21 static const byte TAG_Int_Array = 11;
22 static const int MAX_DEPTH = 512;
23private:
24 wstring name;
25
26protected:
27 Tag(const wstring &name);
28
29public:
30 virtual void write(DataOutput *dos) = 0;
31 virtual void load(DataInput *dis, int tagDepth) = 0;
32 virtual wstring toString() = 0;
33 virtual byte getId() = 0;
34 void print(ostream out);
35 void print(char *prefix, wostream out);
36 wstring getName();
37 Tag *setName(const wstring& name);
38 static Tag *readNamedTag(DataInput *dis);
39 static Tag *readNamedTag(DataInput *dis, int tagDepth);
40 static void writeNamedTag(Tag *tag, DataOutput *dos);
41 static Tag *newTag(byte type, const wstring &name);
42 static wchar_t *getTagName(byte type);
43 virtual ~Tag() {}
44 virtual bool equals(Tag *obj); // 4J Brought forward from 1.2
45 virtual Tag *copy() = 0; // 4J Brought foward from 1.2
46};