Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
1.4 kB · 62 lines
C
at master
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#pragma onceusing namespace std;
#include <unordered_map>
class CompoundTag;class GameRuleDefinition;class Connection;
// A game rule maintains the state for one particular definitionclass GameRule{public: typedef struct _ValueType { union{ __int64 i64; int i; char c; bool b; float f; double d; GameRule *gr; }; bool isPointer;
_ValueType() { i64 = 0; isPointer = false; } } ValueType;
private: GameRuleDefinition *m_definition; Connection *m_connection;
public: typedef unordered_map<wstring,ValueType> stringValueMapType; stringValueMapType m_parameters; // These are the members of this rule that maintain it's state
public: GameRule(GameRuleDefinition *definition, Connection *connection = NULL); virtual ~GameRule();
Connection *getConnection() { return m_connection; } ValueType getParameter(const wstring ¶meterName); void setParameter(const wstring ¶meterName,ValueType value); GameRuleDefinition *getGameRuleDefinition();
// All the hooks go here void onUseTile(int tileId, int x, int y, int z); void onCollectItem(shared_ptr<ItemInstance> item);
// 4J-JEV: For saving. //CompoundTag *toTags(unordered_map<GameRuleDefinition *, int> *map); //static GameRule *fromTags(Connection *c, CompoundTag *cTag, vector<GameRuleDefinition *> *grds);
void write(DataOutputStream *dos); void read(DataInputStream *dos);};