the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 37 lines 722 B view raw
1#pragma once 2#include "InputOutputStream.h" 3#include "Tag.h" 4 5class DoubleTag : public Tag 6{ 7public: 8 double data; 9 DoubleTag(const wstring &name) : Tag(name) {} 10 DoubleTag(const wstring &name, double data) : Tag(name) {this->data = data; } 11 12 void write(DataOutput *dos) { dos->writeDouble(data); } 13 void load(DataInput *dis, int tagDepth) { data = dis->readDouble(); } 14 15 byte getId() { return TAG_Double; } 16 wstring toString() 17 { 18 static wchar_t buf[32]; 19 swprintf(buf,32,L"%f",data); 20 return wstring( buf ); 21 } 22 23 Tag *copy() 24 { 25 return new DoubleTag(getName(), data); 26 } 27 28 bool equals(Tag *obj) 29 { 30 if (Tag::equals(obj)) 31 { 32 DoubleTag *o = (DoubleTag *) obj; 33 return data == o->data; 34 } 35 return false; 36 } 37};